1 <?php |
1 <?php |
2 /** |
2 /** |
3 * Used to setup and fix common variables and include |
3 * Used to set up and fix common variables and include |
4 * the WordPress procedural and class library. |
4 * the WordPress procedural and class library. |
5 * |
5 * |
6 * You should not have to change this file and allows |
6 * Allows for some configuration in wp-config.php (see default-constants.php) |
7 * for some configuration in wp-config.php. |
7 * |
|
8 * @internal This file must be parsable by PHP4. |
8 * |
9 * |
9 * @package WordPress |
10 * @package WordPress |
10 */ |
11 */ |
11 |
12 |
12 if ( !defined('WP_MEMORY_LIMIT') ) |
13 /** |
13 define('WP_MEMORY_LIMIT', '32M'); |
14 * Stores the location of the WordPress directory of functions, classes, and core content. |
14 |
15 * |
15 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) |
16 * @since 1.0.0 |
16 @ini_set('memory_limit', WP_MEMORY_LIMIT); |
17 */ |
17 |
18 define( 'WPINC', 'wp-includes' ); |
18 set_magic_quotes_runtime(0); |
19 |
19 @ini_set('magic_quotes_sybase', 0); |
20 // Include files required for initialization. |
20 |
21 require( ABSPATH . WPINC . '/load.php' ); |
21 if ( function_exists('date_default_timezone_set') ) |
22 require( ABSPATH . WPINC . '/default-constants.php' ); |
22 date_default_timezone_set('UTC'); |
23 require( ABSPATH . WPINC . '/version.php' ); |
23 |
24 |
24 /** |
25 // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. |
25 * Turn register globals off. |
26 wp_initial_constants( ); |
26 * |
27 |
27 * @access private |
28 // Check for the required PHP version and for the MySQL extension or a database drop-in. |
28 * @since 2.1.0 |
29 wp_check_php_mysql_versions(); |
29 * @return null Will return null if register_globals PHP directive was disabled |
30 |
30 */ |
31 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. |
31 function wp_unregister_GLOBALS() { |
32 @ini_set( 'magic_quotes_runtime', 0 ); |
32 if ( !ini_get('register_globals') ) |
33 @ini_set( 'magic_quotes_sybase', 0 ); |
33 return; |
34 |
34 |
35 // Set default timezone in PHP 5. |
35 if ( isset($_REQUEST['GLOBALS']) ) |
36 if ( function_exists( 'date_default_timezone_set' ) ) |
36 die('GLOBALS overwrite attempt detected'); |
37 date_default_timezone_set( 'UTC' ); |
37 |
38 |
38 // Variables that shouldn't be unset |
39 // Turn register_globals off. |
39 $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix'); |
|
40 |
|
41 $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array()); |
|
42 foreach ( $input as $k => $v ) |
|
43 if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { |
|
44 $GLOBALS[$k] = NULL; |
|
45 unset($GLOBALS[$k]); |
|
46 } |
|
47 } |
|
48 |
|
49 wp_unregister_GLOBALS(); |
40 wp_unregister_GLOBALS(); |
50 |
41 |
51 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); |
42 // Ensure these global variables do not exist so they do not interfere with WordPress. |
52 |
43 unset( $wp_filter, $cache_lastcommentmodified ); |
53 /** |
44 |
54 * The $blog_id global, which you can change in the config allows you to create a simple |
45 // Standardize $_SERVER variables across setups. |
55 * multiple blog installation using just one WordPress and changing $blog_id around. |
46 wp_fix_server_vars(); |
56 * |
47 |
57 * @global int $blog_id |
48 // Check if we have received a request due to missing favicon.ico |
58 * @since 2.0.0 |
49 wp_favicon_request(); |
59 */ |
50 |
60 if ( ! isset($blog_id) ) |
51 // Check if we're in maintenance mode. |
61 $blog_id = 1; |
52 wp_maintenance(); |
62 |
53 |
63 // Fix for IIS when running with PHP ISAPI |
54 // Start loading timer. |
64 if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { |
55 timer_start(); |
65 |
56 |
66 // IIS Mod-Rewrite |
57 // Check if we're in WP_DEBUG mode. |
67 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { |
58 wp_debug_mode(); |
68 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; |
59 |
|
60 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. |
|
61 if ( WP_CACHE ) |
|
62 WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); |
|
63 |
|
64 // Define WP_LANG_DIR if not set. |
|
65 wp_set_lang_dir(); |
|
66 |
|
67 // Load early WordPress files. |
|
68 require( ABSPATH . WPINC . '/compat.php' ); |
|
69 require( ABSPATH . WPINC . '/functions.php' ); |
|
70 require( ABSPATH . WPINC . '/class-wp.php' ); |
|
71 require( ABSPATH . WPINC . '/class-wp-error.php' ); |
|
72 require( ABSPATH . WPINC . '/plugin.php' ); |
|
73 require( ABSPATH . WPINC . '/pomo/mo.php' ); |
|
74 |
|
75 // Include the wpdb class and, if present, a db.php database drop-in. |
|
76 require_wp_db(); |
|
77 |
|
78 // Set the database table prefix and the format specifiers for database table columns. |
|
79 $GLOBALS['table_prefix'] = $table_prefix; |
|
80 wp_set_wpdb_vars(); |
|
81 |
|
82 // Start the WordPress object cache, or an external object cache if the drop-in is present. |
|
83 wp_start_object_cache(); |
|
84 |
|
85 // Attach the default filters. |
|
86 require( ABSPATH . WPINC . '/default-filters.php' ); |
|
87 |
|
88 // Initialize multisite if enabled. |
|
89 if ( is_multisite() ) { |
|
90 require( ABSPATH . WPINC . '/ms-blogs.php' ); |
|
91 require( ABSPATH . WPINC . '/ms-settings.php' ); |
|
92 } elseif ( ! defined( 'MULTISITE' ) ) { |
|
93 define( 'MULTISITE', false ); |
|
94 } |
|
95 |
|
96 register_shutdown_function( 'shutdown_action_hook' ); |
|
97 |
|
98 // Stop most of WordPress from being loaded if we just want the basics. |
|
99 if ( SHORTINIT ) |
|
100 return false; |
|
101 |
|
102 // Load the L10n library. |
|
103 require_once( ABSPATH . WPINC . '/l10n.php' ); |
|
104 |
|
105 // Run the installer if WordPress is not installed. |
|
106 wp_not_installed(); |
|
107 |
|
108 // Load most of WordPress. |
|
109 require( ABSPATH . WPINC . '/class-wp-walker.php' ); |
|
110 require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); |
|
111 require( ABSPATH . WPINC . '/formatting.php' ); |
|
112 require( ABSPATH . WPINC . '/capabilities.php' ); |
|
113 require( ABSPATH . WPINC . '/query.php' ); |
|
114 require( ABSPATH . WPINC . '/theme.php' ); |
|
115 require( ABSPATH . WPINC . '/class-wp-theme.php' ); |
|
116 require( ABSPATH . WPINC . '/template.php' ); |
|
117 require( ABSPATH . WPINC . '/user.php' ); |
|
118 require( ABSPATH . WPINC . '/meta.php' ); |
|
119 require( ABSPATH . WPINC . '/general-template.php' ); |
|
120 require( ABSPATH . WPINC . '/link-template.php' ); |
|
121 require( ABSPATH . WPINC . '/author-template.php' ); |
|
122 require( ABSPATH . WPINC . '/post.php' ); |
|
123 require( ABSPATH . WPINC . '/post-template.php' ); |
|
124 require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); |
|
125 require( ABSPATH . WPINC . '/category.php' ); |
|
126 require( ABSPATH . WPINC . '/category-template.php' ); |
|
127 require( ABSPATH . WPINC . '/comment.php' ); |
|
128 require( ABSPATH . WPINC . '/comment-template.php' ); |
|
129 require( ABSPATH . WPINC . '/rewrite.php' ); |
|
130 require( ABSPATH . WPINC . '/feed.php' ); |
|
131 require( ABSPATH . WPINC . '/bookmark.php' ); |
|
132 require( ABSPATH . WPINC . '/bookmark-template.php' ); |
|
133 require( ABSPATH . WPINC . '/kses.php' ); |
|
134 require( ABSPATH . WPINC . '/cron.php' ); |
|
135 require( ABSPATH . WPINC . '/deprecated.php' ); |
|
136 require( ABSPATH . WPINC . '/script-loader.php' ); |
|
137 require( ABSPATH . WPINC . '/taxonomy.php' ); |
|
138 require( ABSPATH . WPINC . '/update.php' ); |
|
139 require( ABSPATH . WPINC . '/canonical.php' ); |
|
140 require( ABSPATH . WPINC . '/shortcodes.php' ); |
|
141 require( ABSPATH . WPINC . '/media.php' ); |
|
142 require( ABSPATH . WPINC . '/http.php' ); |
|
143 require( ABSPATH . WPINC . '/class-http.php' ); |
|
144 require( ABSPATH . WPINC . '/widgets.php' ); |
|
145 require( ABSPATH . WPINC . '/nav-menu.php' ); |
|
146 require( ABSPATH . WPINC . '/nav-menu-template.php' ); |
|
147 require( ABSPATH . WPINC . '/admin-bar.php' ); |
|
148 |
|
149 // Load multisite-specific files. |
|
150 if ( is_multisite() ) { |
|
151 require( ABSPATH . WPINC . '/ms-functions.php' ); |
|
152 require( ABSPATH . WPINC . '/ms-default-filters.php' ); |
|
153 require( ABSPATH . WPINC . '/ms-deprecated.php' ); |
|
154 } |
|
155 |
|
156 // Define constants that rely on the API to obtain the default value. |
|
157 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. |
|
158 wp_plugin_directory_constants( ); |
|
159 |
|
160 // Load must-use plugins. |
|
161 foreach ( wp_get_mu_plugins() as $mu_plugin ) { |
|
162 include_once( $mu_plugin ); |
|
163 } |
|
164 unset( $mu_plugin ); |
|
165 |
|
166 // Load network activated plugins. |
|
167 if ( is_multisite() ) { |
|
168 foreach( wp_get_active_network_plugins() as $network_plugin ) { |
|
169 include_once( $network_plugin ); |
69 } |
170 } |
70 // IIS Isapi_Rewrite |
171 unset( $network_plugin ); |
71 else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { |
172 } |
72 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; |
173 |
73 } |
174 do_action( 'muplugins_loaded' ); |
74 else |
175 |
75 { |
176 if ( is_multisite() ) |
76 // Use ORIG_PATH_INFO if there is no PATH_INFO |
177 ms_cookie_constants( ); |
77 if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) ) |
178 |
78 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; |
179 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). |
79 |
180 wp_cookie_constants( ); |
80 // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) |
181 |
81 if ( isset($_SERVER['PATH_INFO']) ) { |
182 // Define and enforce our SSL constants |
82 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) |
183 wp_ssl_constants( ); |
83 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; |
184 |
84 else |
185 // Create common globals. |
85 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; |
186 require( ABSPATH . WPINC . '/vars.php' ); |
86 } |
187 |
87 |
188 // Make taxonomies and posts available to plugins and themes. |
88 // Append the query string if it exists and isn't null |
189 // @plugin authors: warning: these get registered again on the init hook. |
89 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { |
|
90 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
91 } |
|
92 } |
|
93 } |
|
94 |
|
95 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests |
|
96 if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) ) |
|
97 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; |
|
98 |
|
99 // Fix for Dreamhost and other PHP as CGI hosts |
|
100 if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) |
|
101 unset($_SERVER['PATH_INFO']); |
|
102 |
|
103 // Fix empty PHP_SELF |
|
104 $PHP_SELF = $_SERVER['PHP_SELF']; |
|
105 if ( empty($PHP_SELF) ) |
|
106 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); |
|
107 |
|
108 if ( version_compare( '4.3', phpversion(), '>' ) ) { |
|
109 die( sprintf( /*WP_I18N_OLD_PHP*/'Votre serveur utilise la version %s de PHP mais WordPress nécéssite au moins la version 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) ); |
|
110 } |
|
111 |
|
112 if ( !defined('WP_CONTENT_DIR') ) |
|
113 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
|
114 |
|
115 if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) { |
|
116 include(ABSPATH . '.maintenance'); |
|
117 // If the $upgrading timestamp is older than 10 minutes, don't die. |
|
118 if ( ( time() - $upgrading ) < 600 ) { |
|
119 if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { |
|
120 require_once( WP_CONTENT_DIR . '/maintenance.php' ); |
|
121 die(); |
|
122 } |
|
123 |
|
124 $protocol = $_SERVER["SERVER_PROTOCOL"]; |
|
125 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) |
|
126 $protocol = 'HTTP/1.0'; |
|
127 header( "$protocol 503 Service Unavailable", true, 503 ); |
|
128 header( 'Content-Type: text/html; charset=utf-8' ); |
|
129 header( 'Retry-After: 600' ); |
|
130 ?> |
|
131 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
132 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
133 <head> |
|
134 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
135 <title>Maintenance</title> |
|
136 |
|
137 </head> |
|
138 <body> |
|
139 <h1>Briefly unavailable for scheduled maintenance. Check back in a minute.</h1> |
|
140 </body> |
|
141 </html> |
|
142 <?php |
|
143 die(); |
|
144 } |
|
145 } |
|
146 |
|
147 if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') ) |
|
148 die( /*WP_I18N_OLD_MYSQL*/'Votre installation PHP ne dispose pas de MySQL. Extension requise pour WordPress.'/*/WP_I18N_OLD_MYSQL*/ ); |
|
149 |
|
150 /** |
|
151 * PHP 4 standard microtime start capture. |
|
152 * |
|
153 * @access private |
|
154 * @since 0.71 |
|
155 * @global int $timestart Seconds and Microseconds added together from when function is called. |
|
156 * @return bool Always returns true. |
|
157 */ |
|
158 function timer_start() { |
|
159 global $timestart; |
|
160 $mtime = explode(' ', microtime() ); |
|
161 $mtime = $mtime[1] + $mtime[0]; |
|
162 $timestart = $mtime; |
|
163 return true; |
|
164 } |
|
165 |
|
166 /** |
|
167 * Return and/or display the time from the page start to when function is called. |
|
168 * |
|
169 * You can get the results and print them by doing: |
|
170 * <code> |
|
171 * $nTimePageTookToExecute = timer_stop(); |
|
172 * echo $nTimePageTookToExecute; |
|
173 * </code> |
|
174 * |
|
175 * Or instead, you can do: |
|
176 * <code> |
|
177 * timer_stop(1); |
|
178 * </code> |
|
179 * which will do what the above does. If you need the result, you can assign it to a variable, but |
|
180 * most cases, you only need to echo it. |
|
181 * |
|
182 * @since 0.71 |
|
183 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called |
|
184 * @global int $timeend Seconds and Microseconds added together from when function is called |
|
185 * |
|
186 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time |
|
187 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3. |
|
188 * @return float The "second.microsecond" finished time calculation |
|
189 */ |
|
190 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal |
|
191 global $timestart, $timeend; |
|
192 $mtime = microtime(); |
|
193 $mtime = explode(' ',$mtime); |
|
194 $mtime = $mtime[1] + $mtime[0]; |
|
195 $timeend = $mtime; |
|
196 $timetotal = $timeend-$timestart; |
|
197 $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision); |
|
198 if ( $display ) |
|
199 echo $r; |
|
200 return $r; |
|
201 } |
|
202 timer_start(); |
|
203 |
|
204 // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. |
|
205 if ( defined('WP_DEBUG') && WP_DEBUG ) { |
|
206 if ( defined('E_DEPRECATED') ) |
|
207 error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); |
|
208 else |
|
209 error_reporting(E_ALL); |
|
210 // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On |
|
211 if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY ) |
|
212 ini_set('display_errors', 1); |
|
213 // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log |
|
214 if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG ) { |
|
215 ini_set('log_errors', 1); |
|
216 ini_set('error_log', WP_CONTENT_DIR . '/debug.log'); |
|
217 } |
|
218 } else { |
|
219 define('WP_DEBUG', false); |
|
220 if ( defined('E_RECOVERABLE_ERROR') ) |
|
221 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); |
|
222 else |
|
223 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); |
|
224 } |
|
225 |
|
226 // For an advanced caching plugin to use, static because you would only want one |
|
227 if ( defined('WP_CACHE') && WP_CACHE ) |
|
228 @include WP_CONTENT_DIR . '/advanced-cache.php'; |
|
229 |
|
230 /** |
|
231 * Private |
|
232 */ |
|
233 if ( !defined('MEDIA_TRASH') ) |
|
234 define('MEDIA_TRASH', false); |
|
235 |
|
236 /** |
|
237 * Stores the location of the WordPress directory of functions, classes, and core content. |
|
238 * |
|
239 * @since 1.0.0 |
|
240 */ |
|
241 define('WPINC', 'wp-includes'); |
|
242 |
|
243 if ( !defined('WP_LANG_DIR') ) { |
|
244 /** |
|
245 * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR |
|
246 * and uses that folder if it exists. Or it uses the "languages" folder in WPINC. |
|
247 * |
|
248 * @since 2.1.0 |
|
249 */ |
|
250 if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { |
|
251 define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH |
|
252 if (!defined('LANGDIR')) { |
|
253 // Old static relative path maintained for limited backwards compatibility - won't work in some cases |
|
254 define('LANGDIR', 'wp-content/languages'); |
|
255 } |
|
256 } else { |
|
257 define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH |
|
258 if (!defined('LANGDIR')) { |
|
259 // Old relative path maintained for backwards compatibility |
|
260 define('LANGDIR', WPINC . '/languages'); |
|
261 } |
|
262 } |
|
263 } |
|
264 |
|
265 require (ABSPATH . WPINC . '/compat.php'); |
|
266 require (ABSPATH . WPINC . '/functions.php'); |
|
267 require (ABSPATH . WPINC . '/classes.php'); |
|
268 |
|
269 require_wp_db(); |
|
270 |
|
271 if ( !empty($wpdb->error) ) |
|
272 dead_db(); |
|
273 |
|
274 /** |
|
275 * Format specifiers for DB columns. Columns not listed here default to %s. |
|
276 * @since 2.8.0 |
|
277 * @see wpdb:$field_types |
|
278 * @see wpdb:prepare() |
|
279 * @see wpdb:insert() |
|
280 * @see wpdb:update() |
|
281 */ |
|
282 $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', |
|
283 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', |
|
284 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', |
|
285 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d'); |
|
286 |
|
287 $prefix = $wpdb->set_prefix($table_prefix); |
|
288 |
|
289 if ( is_wp_error($prefix) ) |
|
290 wp_die(/*WP_I18N_BAD_PREFIX*/'<strong>ERREUR</strong>: la ligne <code>$table_prefix</code> du fichier <code>wp-config.php</code> ne doit contenir que des chiffres, lettres ou le caractère souligné.'/*/WP_I18N_BAD_PREFIX*/); |
|
291 |
|
292 /** |
|
293 * Copy an object. |
|
294 * |
|
295 * Returns a cloned copy of an object. |
|
296 * |
|
297 * @since 2.7.0 |
|
298 * |
|
299 * @param object $object The object to clone |
|
300 * @return object The cloned object |
|
301 */ |
|
302 function wp_clone( $object ) { |
|
303 static $can_clone; |
|
304 if ( !isset( $can_clone ) ) { |
|
305 $can_clone = version_compare( phpversion(), '5.0', '>=' ); |
|
306 } |
|
307 return $can_clone ? clone( $object ) : $object; |
|
308 } |
|
309 |
|
310 /** |
|
311 * Whether the current request is in WordPress admin Panel |
|
312 * |
|
313 * Does not inform on whether the user is an admin! Use capability checks to |
|
314 * tell if the user should be accessing a section or not. |
|
315 * |
|
316 * @since 1.5.1 |
|
317 * |
|
318 * @return bool True if inside WordPress administration pages. |
|
319 */ |
|
320 function is_admin() { |
|
321 if ( defined('WP_ADMIN') ) |
|
322 return WP_ADMIN; |
|
323 return false; |
|
324 } |
|
325 |
|
326 if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) { |
|
327 require_once (WP_CONTENT_DIR . '/object-cache.php'); |
|
328 $_wp_using_ext_object_cache = true; |
|
329 } else { |
|
330 require_once (ABSPATH . WPINC . '/cache.php'); |
|
331 $_wp_using_ext_object_cache = false; |
|
332 } |
|
333 |
|
334 wp_cache_init(); |
|
335 if ( function_exists('wp_cache_add_global_groups') ) { |
|
336 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient')); |
|
337 wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); |
|
338 } |
|
339 |
|
340 require (ABSPATH . WPINC . '/plugin.php'); |
|
341 require (ABSPATH . WPINC . '/default-filters.php'); |
|
342 include_once(ABSPATH . WPINC . '/pomo/mo.php'); |
|
343 require_once (ABSPATH . WPINC . '/l10n.php'); |
|
344 |
|
345 if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { |
|
346 if ( defined('WP_SITEURL') ) |
|
347 $link = WP_SITEURL . '/wp-admin/install.php'; |
|
348 elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) |
|
349 $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; |
|
350 else |
|
351 $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; |
|
352 require_once(ABSPATH . WPINC . '/kses.php'); |
|
353 require_once(ABSPATH . WPINC . '/pluggable.php'); |
|
354 require_once(ABSPATH . WPINC . '/formatting.php'); |
|
355 wp_redirect($link); |
|
356 die(); // have to die here ~ Mark |
|
357 } |
|
358 |
|
359 require (ABSPATH . WPINC . '/formatting.php'); |
|
360 require (ABSPATH . WPINC . '/capabilities.php'); |
|
361 require (ABSPATH . WPINC . '/query.php'); |
|
362 require (ABSPATH . WPINC . '/theme.php'); |
|
363 require (ABSPATH . WPINC . '/user.php'); |
|
364 require (ABSPATH . WPINC . '/meta.php'); |
|
365 require (ABSPATH . WPINC . '/general-template.php'); |
|
366 require (ABSPATH . WPINC . '/link-template.php'); |
|
367 require (ABSPATH . WPINC . '/author-template.php'); |
|
368 require (ABSPATH . WPINC . '/post.php'); |
|
369 require (ABSPATH . WPINC . '/post-template.php'); |
|
370 require (ABSPATH . WPINC . '/category.php'); |
|
371 require (ABSPATH . WPINC . '/category-template.php'); |
|
372 require (ABSPATH . WPINC . '/comment.php'); |
|
373 require (ABSPATH . WPINC . '/comment-template.php'); |
|
374 require (ABSPATH . WPINC . '/rewrite.php'); |
|
375 require (ABSPATH . WPINC . '/feed.php'); |
|
376 require (ABSPATH . WPINC . '/bookmark.php'); |
|
377 require (ABSPATH . WPINC . '/bookmark-template.php'); |
|
378 require (ABSPATH . WPINC . '/kses.php'); |
|
379 require (ABSPATH . WPINC . '/cron.php'); |
|
380 require (ABSPATH . WPINC . '/version.php'); |
|
381 require (ABSPATH . WPINC . '/deprecated.php'); |
|
382 require (ABSPATH . WPINC . '/script-loader.php'); |
|
383 require (ABSPATH . WPINC . '/taxonomy.php'); |
|
384 require (ABSPATH . WPINC . '/update.php'); |
|
385 require (ABSPATH . WPINC . '/canonical.php'); |
|
386 require (ABSPATH . WPINC . '/shortcodes.php'); |
|
387 require (ABSPATH . WPINC . '/media.php'); |
|
388 require (ABSPATH . WPINC . '/http.php'); |
|
389 require (ABSPATH . WPINC . '/widgets.php'); |
|
390 |
|
391 if ( !defined('WP_CONTENT_URL') ) |
|
392 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up |
|
393 |
|
394 /** |
|
395 * Allows for the plugins directory to be moved from the default location. |
|
396 * |
|
397 * @since 2.6.0 |
|
398 */ |
|
399 if ( !defined('WP_PLUGIN_DIR') ) |
|
400 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash |
|
401 |
|
402 /** |
|
403 * Allows for the plugins directory to be moved from the default location. |
|
404 * |
|
405 * @since 2.6.0 |
|
406 */ |
|
407 if ( !defined('WP_PLUGIN_URL') ) |
|
408 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash |
|
409 |
|
410 /** |
|
411 * Allows for the plugins directory to be moved from the default location. |
|
412 * |
|
413 * @since 2.1.0 |
|
414 */ |
|
415 if ( !defined('PLUGINDIR') ) |
|
416 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. |
|
417 |
|
418 /** |
|
419 * Allows for the mu-plugins directory to be moved from the default location. |
|
420 * |
|
421 * @since 2.8.0 |
|
422 */ |
|
423 if ( !defined('WPMU_PLUGIN_DIR') ) |
|
424 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash |
|
425 |
|
426 /** |
|
427 * Allows for the mu-plugins directory to be moved from the default location. |
|
428 * |
|
429 * @since 2.8.0 |
|
430 */ |
|
431 if ( !defined('WPMU_PLUGIN_URL') ) |
|
432 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash |
|
433 |
|
434 /** |
|
435 * Allows for the mu-plugins directory to be moved from the default location. |
|
436 * |
|
437 * @since 2.8.0 |
|
438 */ |
|
439 if ( !defined( 'MUPLUGINDIR' ) ) |
|
440 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. |
|
441 |
|
442 if ( is_dir( WPMU_PLUGIN_DIR ) ) { |
|
443 if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { |
|
444 while ( ( $plugin = readdir( $dh ) ) !== false ) { |
|
445 if ( substr( $plugin, -4 ) == '.php' ) { |
|
446 include_once( WPMU_PLUGIN_DIR . '/' . $plugin ); |
|
447 } |
|
448 } |
|
449 } |
|
450 } |
|
451 do_action('muplugins_loaded'); |
|
452 |
|
453 /** |
|
454 * Used to guarantee unique hash cookies |
|
455 * @since 1.5 |
|
456 */ |
|
457 define('COOKIEHASH', md5(get_option('siteurl'))); |
|
458 |
|
459 /** |
|
460 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php |
|
461 * @since 2.5.0 |
|
462 */ |
|
463 $wp_default_secret_key = 'put your unique phrase here'; |
|
464 |
|
465 /** |
|
466 * It is possible to define this in wp-config.php |
|
467 * @since 2.0.0 |
|
468 */ |
|
469 if ( !defined('USER_COOKIE') ) |
|
470 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); |
|
471 |
|
472 /** |
|
473 * It is possible to define this in wp-config.php |
|
474 * @since 2.0.0 |
|
475 */ |
|
476 if ( !defined('PASS_COOKIE') ) |
|
477 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); |
|
478 |
|
479 /** |
|
480 * It is possible to define this in wp-config.php |
|
481 * @since 2.5.0 |
|
482 */ |
|
483 if ( !defined('AUTH_COOKIE') ) |
|
484 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); |
|
485 |
|
486 /** |
|
487 * It is possible to define this in wp-config.php |
|
488 * @since 2.6.0 |
|
489 */ |
|
490 if ( !defined('SECURE_AUTH_COOKIE') ) |
|
491 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); |
|
492 |
|
493 /** |
|
494 * It is possible to define this in wp-config.php |
|
495 * @since 2.6.0 |
|
496 */ |
|
497 if ( !defined('LOGGED_IN_COOKIE') ) |
|
498 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); |
|
499 |
|
500 /** |
|
501 * It is possible to define this in wp-config.php |
|
502 * @since 2.3.0 |
|
503 */ |
|
504 if ( !defined('TEST_COOKIE') ) |
|
505 define('TEST_COOKIE', 'wordpress_test_cookie'); |
|
506 |
|
507 /** |
|
508 * It is possible to define this in wp-config.php |
|
509 * @since 1.2.0 |
|
510 */ |
|
511 if ( !defined('COOKIEPATH') ) |
|
512 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); |
|
513 |
|
514 /** |
|
515 * It is possible to define this in wp-config.php |
|
516 * @since 1.5.0 |
|
517 */ |
|
518 if ( !defined('SITECOOKIEPATH') ) |
|
519 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); |
|
520 |
|
521 /** |
|
522 * It is possible to define this in wp-config.php |
|
523 * @since 2.6.0 |
|
524 */ |
|
525 if ( !defined('ADMIN_COOKIE_PATH') ) |
|
526 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
|
527 |
|
528 /** |
|
529 * It is possible to define this in wp-config.php |
|
530 * @since 2.6.0 |
|
531 */ |
|
532 if ( !defined('PLUGINS_COOKIE_PATH') ) |
|
533 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); |
|
534 |
|
535 /** |
|
536 * It is possible to define this in wp-config.php |
|
537 * @since 2.0.0 |
|
538 */ |
|
539 if ( !defined('COOKIE_DOMAIN') ) |
|
540 define('COOKIE_DOMAIN', false); |
|
541 |
|
542 /** |
|
543 * It is possible to define this in wp-config.php |
|
544 * @since 2.6.0 |
|
545 */ |
|
546 if ( !defined('FORCE_SSL_ADMIN') ) |
|
547 define('FORCE_SSL_ADMIN', false); |
|
548 force_ssl_admin(FORCE_SSL_ADMIN); |
|
549 |
|
550 /** |
|
551 * It is possible to define this in wp-config.php |
|
552 * @since 2.6.0 |
|
553 */ |
|
554 if ( !defined('FORCE_SSL_LOGIN') ) |
|
555 define('FORCE_SSL_LOGIN', false); |
|
556 force_ssl_login(FORCE_SSL_LOGIN); |
|
557 |
|
558 /** |
|
559 * It is possible to define this in wp-config.php |
|
560 * @since 2.5.0 |
|
561 */ |
|
562 if ( !defined( 'AUTOSAVE_INTERVAL' ) ) |
|
563 define( 'AUTOSAVE_INTERVAL', 60 ); |
|
564 |
|
565 /** |
|
566 * It is possible to define this in wp-config.php |
|
567 * @since 2.9.0 |
|
568 */ |
|
569 if ( !defined( 'EMPTY_TRASH_DAYS' ) ) |
|
570 define( 'EMPTY_TRASH_DAYS', 30 ); |
|
571 |
|
572 require (ABSPATH . WPINC . '/vars.php'); |
|
573 |
|
574 // make taxonomies available to plugins and themes |
|
575 // @plugin authors: warning: this gets registered again on the init hook |
|
576 create_initial_taxonomies(); |
190 create_initial_taxonomies(); |
577 |
191 create_initial_post_types(); |
578 // Check for hacks file if the option is enabled |
192 |
579 if ( get_option('hack_file') ) { |
193 // Register the default theme directory root |
580 if ( file_exists(ABSPATH . 'my-hacks.php') ) |
194 register_theme_directory( get_theme_root() ); |
581 require(ABSPATH . 'my-hacks.php'); |
195 |
582 } |
196 // Load active plugins. |
583 |
197 foreach ( wp_get_active_and_valid_plugins() as $plugin ) |
584 $current_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) ); |
198 include_once( $plugin ); |
585 if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) { |
199 unset( $plugin ); |
586 foreach ( $current_plugins as $plugin ) { |
200 |
587 // check the $plugin filename |
201 // Load pluggable functions. |
588 // Validate plugin filename |
202 require( ABSPATH . WPINC . '/pluggable.php' ); |
589 if ( validate_file($plugin) // $plugin must validate as file |
203 require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); |
590 || '.php' != substr($plugin, -4) // $plugin must end with '.php' |
204 |
591 || !file_exists(WP_PLUGIN_DIR . '/' . $plugin) // $plugin must exist |
205 // Set internal encoding. |
592 ) |
206 wp_set_internal_encoding(); |
593 continue; |
207 |
594 |
208 // Run wp_cache_postload() if object cache is enabled and the function exists. |
595 include_once(WP_PLUGIN_DIR . '/' . $plugin); |
209 if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) |
596 } |
|
597 unset($plugin); |
|
598 } |
|
599 unset($current_plugins); |
|
600 |
|
601 require (ABSPATH . WPINC . '/pluggable.php'); |
|
602 |
|
603 /* |
|
604 * In most cases the default internal encoding is latin1, which is of no use, |
|
605 * since we want to use the mb_ functions for utf-8 strings |
|
606 */ |
|
607 if (function_exists('mb_internal_encoding')) { |
|
608 if (!@mb_internal_encoding(get_option('blog_charset'))) |
|
609 mb_internal_encoding('UTF-8'); |
|
610 } |
|
611 |
|
612 |
|
613 if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) |
|
614 wp_cache_postload(); |
210 wp_cache_postload(); |
615 |
211 |
616 do_action('plugins_loaded'); |
212 do_action( 'plugins_loaded' ); |
617 |
213 |
618 $default_constants = array( 'WP_POST_REVISIONS' => true ); |
214 // Define constants which affect functionality if not already defined. |
619 foreach ( $default_constants as $c => $v ) |
215 wp_functionality_constants( ); |
620 @define( $c, $v ); // will fail if the constant is already defined |
216 |
621 unset($default_constants, $c, $v); |
217 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) |
622 |
218 wp_magic_quotes(); |
623 // If already slashed, strip. |
219 |
624 if ( get_magic_quotes_gpc() ) { |
220 do_action( 'sanitize_comment_cookies' ); |
625 $_GET = stripslashes_deep($_GET ); |
|
626 $_POST = stripslashes_deep($_POST ); |
|
627 $_COOKIE = stripslashes_deep($_COOKIE); |
|
628 } |
|
629 |
|
630 // Escape with wpdb. |
|
631 $_GET = add_magic_quotes($_GET ); |
|
632 $_POST = add_magic_quotes($_POST ); |
|
633 $_COOKIE = add_magic_quotes($_COOKIE); |
|
634 $_SERVER = add_magic_quotes($_SERVER); |
|
635 |
|
636 // Force REQUEST to be GET + POST. If SERVER, COOKIE, or ENV are needed, use those superglobals directly. |
|
637 $_REQUEST = array_merge($_GET, $_POST); |
|
638 |
|
639 do_action('sanitize_comment_cookies'); |
|
640 |
221 |
641 /** |
222 /** |
642 * WordPress Query object |
223 * WordPress Query object |
643 * @global object $wp_the_query |
224 * @global object $wp_the_query |
644 * @since 2.0.0 |
225 * @since 2.0.0 |
645 */ |
226 */ |
646 $wp_the_query =& new WP_Query(); |
227 $wp_the_query = new WP_Query(); |
647 |
228 |
648 /** |
229 /** |
649 * Holds the reference to @see $wp_the_query |
230 * Holds the reference to @see $wp_the_query |
650 * Use this global for WordPress queries |
231 * Use this global for WordPress queries |
651 * @global object $wp_query |
232 * @global object $wp_query |
652 * @since 1.5.0 |
233 * @since 1.5.0 |
653 */ |
234 */ |
654 $wp_query =& $wp_the_query; |
235 $wp_query =& $wp_the_query; |
655 |
236 |
656 /** |
237 /** |
657 * Holds the WordPress Rewrite object for creating pretty URLs |
238 * Holds the WordPress Rewrite object for creating pretty URLs |
658 * @global object $wp_rewrite |
239 * @global object $wp_rewrite |
659 * @since 1.5.0 |
240 * @since 1.5.0 |
660 */ |
241 */ |
661 $wp_rewrite =& new WP_Rewrite(); |
242 $GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
662 |
243 |
663 /** |
244 /** |
664 * WordPress Object |
245 * WordPress Object |
665 * @global object $wp |
246 * @global object $wp |
666 * @since 2.0.0 |
247 * @since 2.0.0 |
667 */ |
248 */ |
668 $wp =& new WP(); |
249 $wp = new WP(); |
669 |
250 |
670 /** |
251 /** |
671 * WordPress Widget Factory Object |
252 * WordPress Widget Factory Object |
672 * @global object $wp_widget_factory |
253 * @global object $wp_widget_factory |
673 * @since 2.8.0 |
254 * @since 2.8.0 |
674 */ |
255 */ |
675 $wp_widget_factory =& new WP_Widget_Factory(); |
256 $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); |
676 |
257 |
677 do_action('setup_theme'); |
258 do_action( 'setup_theme' ); |
678 |
259 |
679 /** |
260 // Define the template related constants. |
680 * Web Path to the current active template directory |
261 wp_templating_constants( ); |
681 * @since 1.5.0 |
|
682 */ |
|
683 define('TEMPLATEPATH', get_template_directory()); |
|
684 |
|
685 /** |
|
686 * Web Path to the current active template stylesheet directory |
|
687 * @since 2.1.0 |
|
688 */ |
|
689 define('STYLESHEETPATH', get_stylesheet_directory()); |
|
690 |
262 |
691 // Load the default text localization domain. |
263 // Load the default text localization domain. |
692 load_default_textdomain(); |
264 load_default_textdomain(); |
693 |
265 |
694 /** |
|
695 * The locale of the blog |
|
696 * @since 1.5.0 |
|
697 */ |
|
698 $locale = get_locale(); |
266 $locale = get_locale(); |
699 $locale_file = WP_LANG_DIR . "/$locale.php"; |
267 $locale_file = WP_LANG_DIR . "/$locale.php"; |
700 if ( is_readable($locale_file) ) |
268 if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) |
701 require_once($locale_file); |
269 require( $locale_file ); |
|
270 unset( $locale_file ); |
702 |
271 |
703 // Pull in locale data after loading text domain. |
272 // Pull in locale data after loading text domain. |
704 require_once(ABSPATH . WPINC . '/locale.php'); |
273 require_once( ABSPATH . WPINC . '/locale.php' ); |
705 |
274 |
706 /** |
275 /** |
707 * WordPress Locale object for loading locale domain date and various strings. |
276 * WordPress Locale object for loading locale domain date and various strings. |
708 * @global object $wp_locale |
277 * @global object $wp_locale |
709 * @since 2.1.0 |
278 * @since 2.1.0 |
710 */ |
279 */ |
711 $wp_locale =& new WP_Locale(); |
280 $GLOBALS['wp_locale'] = new WP_Locale(); |
712 |
281 |
713 // Load functions for active theme. |
282 // Load the functions for the active theme, for both parent and child theme if applicable. |
714 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) |
283 if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { |
715 include(STYLESHEETPATH . '/functions.php'); |
284 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) |
716 if ( file_exists(TEMPLATEPATH . '/functions.php') ) |
285 include( STYLESHEETPATH . '/functions.php' ); |
717 include(TEMPLATEPATH . '/functions.php'); |
286 if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) |
718 |
287 include( TEMPLATEPATH . '/functions.php' ); |
719 // Load in support for template functions which the theme supports |
288 } |
720 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); |
289 |
721 |
290 do_action( 'after_setup_theme' ); |
722 /** |
291 |
723 * Runs just before PHP shuts down execution. |
292 // Set up current user. |
724 * |
293 $wp->init(); |
725 * @access private |
294 |
726 * @since 1.2.0 |
295 /** |
727 */ |
296 * Most of WP is loaded at this stage, and the user is authenticated. WP continues |
728 function shutdown_action_hook() { |
297 * to load on the init hook that follows (e.g. widgets), and many plugins instantiate |
729 do_action('shutdown'); |
298 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). |
730 wp_cache_close(); |
299 * |
731 } |
300 * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. |
732 register_shutdown_function('shutdown_action_hook'); |
301 */ |
733 |
302 do_action( 'init' ); |
734 $wp->init(); // Sets up current user. |
303 |
735 |
304 // Check site status |
736 // Everything is loaded and initialized. |
305 if ( is_multisite() ) { |
737 do_action('init'); |
306 if ( true !== ( $file = ms_site_check() ) ) { |
738 |
307 require( $file ); |
739 ?> |
308 die(); |
|
309 } |
|
310 unset($file); |
|
311 } |
|
312 |
|
313 /** |
|
314 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. |
|
315 * |
|
316 * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for |
|
317 * users not logged in. |
|
318 * |
|
319 * @link http://codex.wordpress.org/AJAX_in_Plugins |
|
320 * |
|
321 * @since 3.0.0 |
|
322 */ |
|
323 do_action('wp_loaded'); |