2003-06-12 18:44:37 -04:00
|
|
|
<?php
|
2007-12-20 15:44:52 -05:00
|
|
|
/**
|
2010-03-17 00:39:50 -04:00
|
|
|
* Used to set up and fix common variables and include
|
2007-12-20 15:44:52 -05:00
|
|
|
* the WordPress procedural and class library.
|
|
|
|
*
|
2010-01-15 17:03:41 -05:00
|
|
|
* Allows for some configuration in wp-config.php (see default-constants.php)
|
2007-12-20 15:44:52 -05:00
|
|
|
*
|
2011-06-29 12:50:07 -04:00
|
|
|
* @internal This file must be parsable by PHP4.
|
|
|
|
*
|
2007-12-20 15:44:52 -05:00
|
|
|
* @package WordPress
|
|
|
|
*/
|
|
|
|
|
2010-01-10 13:10:51 -05:00
|
|
|
/**
|
2010-01-15 17:03:41 -05:00
|
|
|
* Stores the location of the WordPress directory of functions, classes, and core content.
|
2010-01-10 13:10:51 -05:00
|
|
|
*
|
2010-01-15 17:03:41 -05:00
|
|
|
* @since 1.0.0
|
2010-01-10 13:10:51 -05:00
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
define( 'WPINC', 'wp-includes' );
|
2010-01-10 13:10:51 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Include files required for initialization.
|
|
|
|
require( ABSPATH . WPINC . '/load.php' );
|
|
|
|
require( ABSPATH . WPINC . '/default-constants.php' );
|
|
|
|
require( ABSPATH . WPINC . '/version.php' );
|
2008-01-29 12:25:45 -05:00
|
|
|
|
2011-04-28 12:25:36 -04:00
|
|
|
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
|
2013-01-04 05:13:51 -05:00
|
|
|
wp_initial_constants();
|
2008-01-29 12:25:45 -05:00
|
|
|
|
2011-06-29 12:46:46 -04:00
|
|
|
// Check for the required PHP version and for the MySQL extension or a database drop-in.
|
|
|
|
wp_check_php_mysql_versions();
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
|
2011-08-15 02:42:43 -04:00
|
|
|
@ini_set( 'magic_quotes_runtime', 0 );
|
|
|
|
@ini_set( 'magic_quotes_sybase', 0 );
|
2008-03-03 16:05:23 -05:00
|
|
|
|
2012-08-17 19:40:09 -04:00
|
|
|
// WordPress calculates offsets from UTC.
|
|
|
|
date_default_timezone_set( 'UTC' );
|
2009-12-02 12:50:07 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Turn register_globals off.
|
2007-09-03 19:32:58 -04:00
|
|
|
wp_unregister_GLOBALS();
|
2007-06-12 17:59:22 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Standardize $_SERVER variables across setups.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_fix_server_vars();
|
2005-11-10 18:57:45 -05:00
|
|
|
|
2011-03-21 19:44:30 -04:00
|
|
|
// Check if we have received a request due to missing favicon.ico
|
2010-02-18 18:41:50 -05:00
|
|
|
wp_favicon_request();
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Check if we're in maintenance mode.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_maintenance();
|
2006-09-07 19:26:52 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Start loading timer.
|
2004-10-04 04:03:52 -04:00
|
|
|
timer_start();
|
2004-08-10 18:02:26 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Check if we're in WP_DEBUG mode.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_debug_mode();
|
2004-01-02 18:55:40 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
|
2010-01-15 17:03:41 -05:00
|
|
|
if ( WP_CACHE )
|
2010-05-02 18:18:36 -04:00
|
|
|
WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );
|
2005-02-14 19:46:58 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Define WP_LANG_DIR if not set.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_set_lang_dir();
|
2008-08-05 19:56:52 -04:00
|
|
|
|
2010-02-13 18:09:54 -05:00
|
|
|
// Load early WordPress files.
|
2011-04-07 11:47:04 -04:00
|
|
|
require( ABSPATH . WPINC . '/compat.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/functions.php' );
|
2010-10-30 03:02:06 -04:00
|
|
|
require( ABSPATH . WPINC . '/class-wp.php' );
|
|
|
|
require( ABSPATH . WPINC . '/class-wp-error.php' );
|
2010-10-14 16:39:23 -04:00
|
|
|
require( ABSPATH . WPINC . '/plugin.php' );
|
2012-01-26 15:34:27 -05:00
|
|
|
require( ABSPATH . WPINC . '/pomo/mo.php' );
|
2007-09-13 02:23:23 -04:00
|
|
|
|
2010-09-20 15:13:47 -04:00
|
|
|
// Include the wpdb class and, if present, a db.php database drop-in.
|
2009-04-10 17:56:30 -04:00
|
|
|
require_wp_db();
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Set the database table prefix and the format specifiers for database table columns.
|
2011-10-18 15:37:07 -04:00
|
|
|
$GLOBALS['table_prefix'] = $table_prefix;
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_set_wpdb_vars();
|
2009-04-15 15:14:43 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Start the WordPress object cache, or an external object cache if the drop-in is present.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_start_object_cache();
|
2009-12-13 19:38:05 -05:00
|
|
|
|
2012-01-26 15:34:27 -05:00
|
|
|
// Attach the default filters.
|
2010-02-13 18:09:54 -05:00
|
|
|
require( ABSPATH . WPINC . '/default-filters.php' );
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Initialize multisite if enabled.
|
2010-02-13 17:35:11 -05:00
|
|
|
if ( is_multisite() ) {
|
2010-02-14 20:08:23 -05:00
|
|
|
require( ABSPATH . WPINC . '/ms-blogs.php' );
|
2010-01-28 11:09:52 -05:00
|
|
|
require( ABSPATH . WPINC . '/ms-settings.php' );
|
2010-04-04 20:00:13 -04:00
|
|
|
} elseif ( ! defined( 'MULTISITE' ) ) {
|
|
|
|
define( 'MULTISITE', false );
|
2010-02-13 17:35:11 -05:00
|
|
|
}
|
2010-01-10 13:10:51 -05:00
|
|
|
|
2011-07-21 15:37:47 -04:00
|
|
|
register_shutdown_function( 'shutdown_action_hook' );
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Stop most of WordPress from being loaded if we just want the basics.
|
|
|
|
if ( SHORTINIT )
|
2010-01-10 13:10:51 -05:00
|
|
|
return false;
|
|
|
|
|
2012-01-25 19:16:01 -05:00
|
|
|
// Load the L10n library.
|
2012-01-26 15:34:27 -05:00
|
|
|
require_once( ABSPATH . WPINC . '/l10n.php' );
|
2004-12-19 02:26:43 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Run the installer if WordPress is not installed.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_not_installed();
|
2004-12-19 02:26:43 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Load most of WordPress.
|
2010-10-30 10:13:43 -04:00
|
|
|
require( ABSPATH . WPINC . '/class-wp-walker.php' );
|
|
|
|
require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/formatting.php' );
|
|
|
|
require( ABSPATH . WPINC . '/capabilities.php' );
|
|
|
|
require( ABSPATH . WPINC . '/query.php' );
|
2013-08-27 12:39:09 -04:00
|
|
|
require( ABSPATH . WPINC . '/date.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/theme.php' );
|
Introduce WP_Theme, wp_get_themes(), and wp_get_theme() to replace get_themes(), get_theme(), get_theme_data(), current_theme_info(), and others.
* Getters and Helpers: Introduces a series of methods to allow for easy generation of headers for display, and other theme metadata, including page templates.
* Screenshots: Handles support for multiple screenshots. (see # Additional screenshots must be PNG and start with screenshot-2.png, and be sequential to be counted. see #19816.
* Error Handling: Broken themes have a WP_Error object attached to them.
* Caching: Introduces a wp_cache_themes_persistently filter (also in [20020]) to enable persistent caching of all filesystem and sanitization operations normally handled by WP_Theme (and formerly get_file_data() and get_themes()). Themes are cached individually and across five different cache keys for different data pieces.
* Compatibility: A WP_Theme object is backwards compatible with a theme's array formerly returned by get_themes() and get_theme(), and an stdClass object formerly returned by current_theme_info().
* i18n/L10n: Theme headers are now localizable with proper Text Domain and Domain Path headers, like plugins. (Language packs may remove the requirement for headers.) For page templates, see #6007 (not fixed yet, but will be easy now). For headers, fixes #15858.
* PHP and CSS files: New methods that fetch a list of theme files (for the theme editor) only on demand, rather than only loading them into memory. fixes #11214.
Functions deprecated:
* get_themes(), get_allowed_themes() and get_broken_themes() -- use wp_get_themes()
* get_theme() and current_theme_info() -- use wp_get_theme()
* get_site_allowed_themes() -- use WP_Theme::get_allowed_on_network()
* wpmu_get_blog_allowedthemes() -- use WP_theme::get_allowed_on_site()
see also [20016], [20018], [20019], [20020], [20021], [20022], [20025], [20026], [20027]. also fixes #19244.
see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-28 16:24:44 -05:00
|
|
|
require( ABSPATH . WPINC . '/class-wp-theme.php' );
|
2012-02-27 20:49:49 -05:00
|
|
|
require( ABSPATH . WPINC . '/template.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/user.php' );
|
|
|
|
require( ABSPATH . WPINC . '/meta.php' );
|
|
|
|
require( ABSPATH . WPINC . '/general-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/link-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/author-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/post.php' );
|
|
|
|
require( ABSPATH . WPINC . '/post-template.php' );
|
2013-02-21 16:24:34 -05:00
|
|
|
require( ABSPATH . WPINC . '/revision.php' );
|
|
|
|
require( ABSPATH . WPINC . '/post-formats.php' );
|
2012-04-27 00:54:36 -04:00
|
|
|
require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/category.php' );
|
|
|
|
require( ABSPATH . WPINC . '/category-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/comment.php' );
|
|
|
|
require( ABSPATH . WPINC . '/comment-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/rewrite.php' );
|
|
|
|
require( ABSPATH . WPINC . '/feed.php' );
|
|
|
|
require( ABSPATH . WPINC . '/bookmark.php' );
|
|
|
|
require( ABSPATH . WPINC . '/bookmark-template.php' );
|
|
|
|
require( ABSPATH . WPINC . '/kses.php' );
|
|
|
|
require( ABSPATH . WPINC . '/cron.php' );
|
|
|
|
require( ABSPATH . WPINC . '/deprecated.php' );
|
|
|
|
require( ABSPATH . WPINC . '/script-loader.php' );
|
|
|
|
require( ABSPATH . WPINC . '/taxonomy.php' );
|
|
|
|
require( ABSPATH . WPINC . '/update.php' );
|
|
|
|
require( ABSPATH . WPINC . '/canonical.php' );
|
|
|
|
require( ABSPATH . WPINC . '/shortcodes.php' );
|
2012-09-25 04:39:26 -04:00
|
|
|
require( ABSPATH . WPINC . '/class-wp-embed.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/media.php' );
|
|
|
|
require( ABSPATH . WPINC . '/http.php' );
|
2010-04-13 17:45:57 -04:00
|
|
|
require( ABSPATH . WPINC . '/class-http.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
require( ABSPATH . WPINC . '/widgets.php' );
|
2010-02-24 03:06:36 -05:00
|
|
|
require( ABSPATH . WPINC . '/nav-menu.php' );
|
|
|
|
require( ABSPATH . WPINC . '/nav-menu-template.php' );
|
2010-09-27 16:26:36 -04:00
|
|
|
require( ABSPATH . WPINC . '/admin-bar.php' );
|
2010-01-19 12:27:03 -05:00
|
|
|
|
|
|
|
// Load multisite-specific files.
|
2010-01-06 15:19:35 -05:00
|
|
|
if ( is_multisite() ) {
|
2010-02-20 07:50:09 -05:00
|
|
|
require( ABSPATH . WPINC . '/ms-functions.php' );
|
|
|
|
require( ABSPATH . WPINC . '/ms-default-filters.php' );
|
|
|
|
require( ABSPATH . WPINC . '/ms-deprecated.php' );
|
2010-01-06 15:19:35 -05:00
|
|
|
}
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Define constants that rely on the API to obtain the default value.
|
|
|
|
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
|
2013-01-04 05:13:51 -05:00
|
|
|
wp_plugin_directory_constants();
|
2010-01-15 17:03:41 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Load must-use plugins.
|
2010-02-12 02:59:11 -05:00
|
|
|
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
|
2010-01-19 12:27:03 -05:00
|
|
|
include_once( $mu_plugin );
|
|
|
|
}
|
2010-02-02 16:41:17 -05:00
|
|
|
unset( $mu_plugin );
|
2010-01-10 13:10:51 -05:00
|
|
|
|
2010-11-23 19:19:38 -05:00
|
|
|
// Load network activated plugins.
|
|
|
|
if ( is_multisite() ) {
|
|
|
|
foreach( wp_get_active_network_plugins() as $network_plugin ) {
|
|
|
|
include_once( $network_plugin );
|
|
|
|
}
|
|
|
|
unset( $network_plugin );
|
|
|
|
}
|
|
|
|
|
2013-10-07 15:34:09 -04:00
|
|
|
/**
|
|
|
|
* Fires once all must-use and network-activated plugins have loaded.
|
|
|
|
*
|
|
|
|
* @since 2.8.0
|
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
do_action( 'muplugins_loaded' );
|
2009-03-06 19:03:40 -05:00
|
|
|
|
2010-04-23 12:18:33 -04:00
|
|
|
if ( is_multisite() )
|
2010-02-12 03:22:34 -05:00
|
|
|
ms_cookie_constants( );
|
2008-05-27 13:46:01 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
2013-01-04 05:13:51 -05:00
|
|
|
wp_cookie_constants();
|
2010-02-12 02:56:28 -05:00
|
|
|
|
|
|
|
// Define and enforce our SSL constants
|
2013-01-04 05:13:51 -05:00
|
|
|
wp_ssl_constants();
|
2005-07-18 15:55:24 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Create common globals.
|
|
|
|
require( ABSPATH . WPINC . '/vars.php' );
|
2003-12-31 18:51:41 -05:00
|
|
|
|
2010-04-08 12:45:18 -04:00
|
|
|
// Make taxonomies and posts available to plugins and themes.
|
|
|
|
// @plugin authors: warning: these get registered again on the init hook.
|
2009-06-15 17:53:51 -04:00
|
|
|
create_initial_taxonomies();
|
2010-04-08 12:45:18 -04:00
|
|
|
create_initial_post_types();
|
2009-06-15 17:53:51 -04:00
|
|
|
|
2010-11-17 11:11:44 -05:00
|
|
|
// Register the default theme directory root
|
|
|
|
register_theme_directory( get_theme_root() );
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Load active plugins.
|
2010-02-12 02:59:11 -05:00
|
|
|
foreach ( wp_get_active_and_valid_plugins() as $plugin )
|
2010-01-19 12:27:03 -05:00
|
|
|
include_once( $plugin );
|
|
|
|
unset( $plugin );
|
2004-04-19 01:19:45 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Load pluggable functions.
|
|
|
|
require( ABSPATH . WPINC . '/pluggable.php' );
|
2010-02-18 18:17:06 -05:00
|
|
|
require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
|
2005-04-04 19:25:51 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Set internal encoding.
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_set_internal_encoding();
|
2008-03-03 16:05:23 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Run wp_cache_postload() if object cache is enabled and the function exists.
|
|
|
|
if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
|
2005-02-14 19:46:58 -05:00
|
|
|
wp_cache_postload();
|
|
|
|
|
2013-10-07 15:34:09 -04:00
|
|
|
/**
|
|
|
|
* Fires once activated plugins have loaded.
|
|
|
|
*
|
|
|
|
* Pluggable functions are also available at this point in the loading order.
|
|
|
|
*
|
|
|
|
* @since 1.5.2
|
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
do_action( 'plugins_loaded' );
|
2005-02-14 19:46:58 -05:00
|
|
|
|
2010-02-12 02:56:28 -05:00
|
|
|
// Define constants which affect functionality if not already defined.
|
2013-01-04 05:13:51 -05:00
|
|
|
wp_functionality_constants();
|
2005-07-05 16:47:22 -04:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
|
2010-01-15 17:03:41 -05:00
|
|
|
wp_magic_quotes();
|
2009-07-31 18:22:54 -04:00
|
|
|
|
2013-10-07 15:34:09 -04:00
|
|
|
/**
|
|
|
|
* Fires when comment cookies are sanitized.
|
|
|
|
*
|
|
|
|
* @since 2.0.11
|
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
do_action( 'sanitize_comment_cookies' );
|
2006-06-22 16:52:12 -04:00
|
|
|
|
2007-12-20 15:44:52 -05:00
|
|
|
/**
|
|
|
|
* WordPress Query object
|
|
|
|
* @global object $wp_the_query
|
2008-01-09 12:48:00 -05:00
|
|
|
* @since 2.0.0
|
2007-12-20 15:44:52 -05:00
|
|
|
*/
|
2011-03-30 16:50:05 -04:00
|
|
|
$wp_the_query = new WP_Query();
|
2007-12-20 15:44:52 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds the reference to @see $wp_the_query
|
|
|
|
* Use this global for WordPress queries
|
|
|
|
* @global object $wp_query
|
2008-01-09 12:48:00 -05:00
|
|
|
* @since 1.5.0
|
2007-12-20 15:44:52 -05:00
|
|
|
*/
|
2012-11-07 15:03:28 -05:00
|
|
|
$wp_query = $wp_the_query;
|
2007-12-20 15:44:52 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds the WordPress Rewrite object for creating pretty URLs
|
|
|
|
* @global object $wp_rewrite
|
2008-01-09 12:48:00 -05:00
|
|
|
* @since 1.5.0
|
2007-12-20 15:44:52 -05:00
|
|
|
*/
|
2011-12-20 15:43:15 -05:00
|
|
|
$GLOBALS['wp_rewrite'] = new WP_Rewrite();
|
2007-12-20 15:44:52 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* WordPress Object
|
|
|
|
* @global object $wp
|
2008-01-09 12:48:00 -05:00
|
|
|
* @since 2.0.0
|
2007-12-20 15:44:52 -05:00
|
|
|
*/
|
2011-03-30 16:50:05 -04:00
|
|
|
$wp = new WP();
|
2005-06-10 19:15:13 -04:00
|
|
|
|
2009-03-17 19:44:36 -04:00
|
|
|
/**
|
|
|
|
* WordPress Widget Factory Object
|
|
|
|
* @global object $wp_widget_factory
|
|
|
|
* @since 2.8.0
|
|
|
|
*/
|
2011-08-11 00:45:14 -04:00
|
|
|
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
|
2009-03-17 19:44:36 -04:00
|
|
|
|
2012-08-09 12:28:15 -04:00
|
|
|
/**
|
|
|
|
* WordPress User Roles
|
|
|
|
* @global object $wp_roles
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
$GLOBALS['wp_roles'] = new WP_Roles();
|
|
|
|
|
2013-10-07 15:34:09 -04:00
|
|
|
/**
|
|
|
|
* Fires before the theme is loaded.
|
|
|
|
*
|
|
|
|
* @since 2.6.0
|
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
do_action( 'setup_theme' );
|
2007-12-20 15:44:52 -05:00
|
|
|
|
2010-02-12 02:56:28 -05:00
|
|
|
// Define the template related constants.
|
|
|
|
wp_templating_constants( );
|
2005-07-13 15:29:18 -04:00
|
|
|
|
|
|
|
// Load the default text localization domain.
|
|
|
|
load_default_textdomain();
|
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
$locale = get_locale();
|
|
|
|
$locale_file = WP_LANG_DIR . "/$locale.php";
|
2012-02-03 19:32:34 -05:00
|
|
|
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) )
|
2010-02-20 07:50:09 -05:00
|
|
|
require( $locale_file );
|
2012-01-31 09:30:36 -05:00
|
|
|
unset( $locale_file );
|
2010-01-19 12:27:03 -05:00
|
|
|
|
|
|
|
// Pull in locale data after loading text domain.
|
2012-01-26 15:34:27 -05:00
|
|
|
require_once( ABSPATH . WPINC . '/locale.php' );
|
2005-07-13 15:29:18 -04:00
|
|
|
|
2007-12-20 15:44:52 -05:00
|
|
|
/**
|
|
|
|
* WordPress Locale object for loading locale domain date and various strings.
|
|
|
|
* @global object $wp_locale
|
2008-01-09 12:48:00 -05:00
|
|
|
* @since 2.1.0
|
2007-12-20 15:44:52 -05:00
|
|
|
*/
|
2011-09-22 18:49:30 -04:00
|
|
|
$GLOBALS['wp_locale'] = new WP_Locale();
|
2006-04-01 19:20:11 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Load the functions for the active theme, for both parent and child theme if applicable.
|
2011-06-10 23:04:04 -04:00
|
|
|
if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
|
2011-04-27 17:16:49 -04:00
|
|
|
if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
|
|
|
|
include( STYLESHEETPATH . '/functions.php' );
|
|
|
|
if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
|
|
|
|
include( TEMPLATEPATH . '/functions.php' );
|
|
|
|
}
|
2010-01-19 12:27:03 -05:00
|
|
|
|
2013-10-07 15:34:09 -04:00
|
|
|
/**
|
|
|
|
* Fires after the theme is loaded.
|
|
|
|
*
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2010-02-19 05:00:00 -05:00
|
|
|
do_action( 'after_setup_theme' );
|
2010-02-14 16:27:55 -05:00
|
|
|
|
2010-01-19 12:27:03 -05:00
|
|
|
// Set up current user.
|
|
|
|
$wp->init();
|
2008-01-09 15:08:59 -05:00
|
|
|
|
2010-02-27 22:08:16 -05:00
|
|
|
/**
|
2013-10-07 15:34:09 -04:00
|
|
|
* Fires after WordPress has finished loading but before any headers are sent.
|
|
|
|
*
|
2010-02-27 22:08:16 -05:00
|
|
|
* Most of WP is loaded at this stage, and the user is authenticated. WP continues
|
|
|
|
* to load on the init hook that follows (e.g. widgets), and many plugins instantiate
|
|
|
|
* themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
|
|
|
|
*
|
|
|
|
* If you wish to plug an action once WP is loaded, use the wp_loaded hook below.
|
2013-10-07 15:34:09 -04:00
|
|
|
*
|
|
|
|
* @since 1.5.2
|
2010-02-27 22:08:16 -05:00
|
|
|
*/
|
2010-01-19 12:27:03 -05:00
|
|
|
do_action( 'init' );
|
2005-11-10 20:37:25 -05:00
|
|
|
|
2010-04-23 12:18:33 -04:00
|
|
|
// Check site status
|
|
|
|
if ( is_multisite() ) {
|
|
|
|
if ( true !== ( $file = ms_site_check() ) ) {
|
|
|
|
require( $file );
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
unset($file);
|
|
|
|
}
|
|
|
|
|
2010-02-27 22:08:16 -05:00
|
|
|
/**
|
2010-02-28 14:25:53 -05:00
|
|
|
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
|
2010-02-27 22:08:16 -05:00
|
|
|
*
|
2010-03-26 15:44:43 -04:00
|
|
|
* AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
|
|
|
|
* users not logged in.
|
|
|
|
*
|
|
|
|
* @link http://codex.wordpress.org/AJAX_in_Plugins
|
2010-02-28 14:25:53 -05:00
|
|
|
*
|
|
|
|
* @since 3.0.0
|
2010-02-27 22:08:16 -05:00
|
|
|
*/
|
2013-10-07 15:34:09 -04:00
|
|
|
do_action( 'wp_loaded' );
|