define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH); if ( !defined('TEST_COOKIE') ) define('TEST_COOKIE', 'wordpress_test_cookie'); if ( !defined('COOKIEPATH') ) define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); if ( !defined('SITECOOKIEPATH') ) define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); if ( !defined('COOKIE_DOMAIN') ) define('COOKIE_DOMAIN', false); require (ABSPATH . WPINC . '/vars.php'); // Check for hacks file if the option is enabled if (get_option('hack_file')) { if (file_exists(ABSPATH . 'my-hacks.php')) require(ABSPATH . 'my-hacks.php'); } if ( get_option('active_plugins') ) { $current_plugins = get_option('active_plugins'); if ( is_array($current_plugins) ) { foreach ($current_plugins as $plugin) { if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . '/' . $plugin)) include_once(ABSPATH . PLUGINDIR . '/' . $plugin); } } } require (ABSPATH . WPINC . '/pluggable.php'); if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) wp_cache_postload(); do_action('plugins_loaded'); // If already slashed, strip. if ( get_magic_quotes_gpc() ) { $_GET = stripslashes_deep($_GET ); $_POST = stripslashes_deep($_POST ); $_COOKIE = stripslashes_deep($_COOKIE); } // Escape with wpdb. $_GET = add_magic_quotes($_GET ); $_POST = add_magic_quotes($_POST ); $_COOKIE = add_magic_quotes($_COOKIE); $_SERVER = add_magic_quotes($_SERVER); do_action('sanitize_comment_cookies'); $wp_the_query =& new WP_Query(); $wp_query =& $wp_the_query; $wp_rewrite =& new WP_Rewrite(); $wp =& new WP(); validate_current_theme(); define('TEMPLATEPATH', get_template_directory()); define('STYLESHEETPATH', get_stylesheet_directory()); // Load the default text localization domain. load_default_textdomain(); $locale = get_locale(); $locale_file = ABSPATH . LANGDIR . "/$locale.php"; if ( is_readable($locale_file) ) require_once($locale_file); // Pull in locale data after loading text domain. require_once(ABSPATH . WPINC . '/locale.php'); $wp_locale =& new WP_Locale(); // Load functions for active theme. if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) include(STYLESHEETPATH . '/functions.php'); if ( file_exists(TEMPLATEPATH . '/functions.php') ) include(TEMPLATEPATH . '/functions.php'); function shutdown_action_hook() { do_action('shutdown'); wp_cache_close(); } register_shutdown_function('shutdown_action_hook'); // Everything is loaded and initialized. do_action('init');