author | ymh <ymh.work@gmail.com> |
Tue, 22 Oct 2019 16:11:46 +0200 | |
changeset 15 | 3d4e9c994f10 |
parent 9 | 177826044cd9 |
child 16 | a86126ab1dd4 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Used to set up and fix common variables and include |
|
4 |
* the WordPress procedural and class library. |
|
5 |
* |
|
6 |
* Allows for some configuration in wp-config.php (see default-constants.php) |
|
7 |
* |
|
8 |
* @package WordPress |
|
9 |
*/ |
|
10 |
||
11 |
/** |
|
12 |
* Stores the location of the WordPress directory of functions, classes, and core content. |
|
13 |
* |
|
14 |
* @since 1.0.0 |
|
15 |
*/ |
|
16 |
define( 'WPINC', 'wp-includes' ); |
|
17 |
||
18 |
// Include files required for initialization. |
|
19 |
require( ABSPATH . WPINC . '/load.php' ); |
|
9 | 20 |
require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' ); |
21 |
require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' ); |
|
22 |
require( ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php' ); |
|
23 |
require( ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php' ); |
|
24 |
require( ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php' ); |
|
25 |
require( ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php' ); |
|
26 |
require( ABSPATH . WPINC . '/class-wp-recovery-mode.php' ); |
|
27 |
require( ABSPATH . WPINC . '/error-protection.php' ); |
|
0 | 28 |
require( ABSPATH . WPINC . '/default-constants.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
require_once( ABSPATH . WPINC . '/plugin.php' ); |
5 | 30 |
|
31 |
/* |
|
32 |
* These can't be directly globalized in version.php. When updating, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
* we're including version.php from another installation and don't want |
5 | 34 |
* these values to be overridden if already set. |
35 |
*/ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package; |
0 | 37 |
require( ABSPATH . WPINC . '/version.php' ); |
38 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
39 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
* If not already configured, `$blog_id` will default to 1 in a single site |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
41 |
* configuration. In multisite, it will be overridden by default in ms-settings.php. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
42 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
43 |
* @global int $blog_id |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
44 |
* @since 2.0.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
45 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
46 |
global $blog_id; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
47 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
48 |
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE. |
0 | 49 |
wp_initial_constants(); |
50 |
||
9 | 51 |
// Make sure we register the shutdown handler for fatal errors as soon as possible. |
52 |
wp_register_fatal_error_handler(); |
|
53 |
||
0 | 54 |
// Check for the required PHP version and for the MySQL extension or a database drop-in. |
55 |
wp_check_php_mysql_versions(); |
|
56 |
||
57 |
// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. |
|
58 |
@ini_set( 'magic_quotes_runtime', 0 ); |
|
9 | 59 |
@ini_set( 'magic_quotes_sybase', 0 ); |
0 | 60 |
|
61 |
// WordPress calculates offsets from UTC. |
|
62 |
date_default_timezone_set( 'UTC' ); |
|
63 |
||
64 |
// Turn register_globals off. |
|
65 |
wp_unregister_GLOBALS(); |
|
66 |
||
67 |
// Standardize $_SERVER variables across setups. |
|
68 |
wp_fix_server_vars(); |
|
69 |
||
70 |
// Check if we have received a request due to missing favicon.ico |
|
71 |
wp_favicon_request(); |
|
72 |
||
73 |
// Check if we're in maintenance mode. |
|
74 |
wp_maintenance(); |
|
75 |
||
76 |
// Start loading timer. |
|
77 |
timer_start(); |
|
78 |
||
79 |
// Check if we're in WP_DEBUG mode. |
|
80 |
wp_debug_mode(); |
|
81 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
82 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
83 |
* Filters whether to enable loading of the advanced-cache.php drop-in. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
84 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
* This filter runs before it can be used by plugins. It is designed for non-web |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
86 |
* run-times. If false is returned, advanced-cache.php will never be loaded. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
87 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
88 |
* @since 4.6.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
89 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
90 |
* @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
91 |
* Default true. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
92 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
93 |
if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
94 |
// For an advanced caching plugin to use. Uses a static drop-in because you would only want one. |
0 | 95 |
WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); |
96 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
97 |
// Re-initialize any hooks added manually by advanced-cache.php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
98 |
if ( $wp_filter ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
99 |
$wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
100 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
101 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
102 |
|
0 | 103 |
// Define WP_LANG_DIR if not set. |
104 |
wp_set_lang_dir(); |
|
105 |
||
106 |
// Load early WordPress files. |
|
107 |
require( ABSPATH . WPINC . '/compat.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
108 |
require( ABSPATH . WPINC . '/class-wp-list-util.php' ); |
9 | 109 |
require( ABSPATH . WPINC . '/formatting.php' ); |
110 |
require( ABSPATH . WPINC . '/meta.php' ); |
|
0 | 111 |
require( ABSPATH . WPINC . '/functions.php' ); |
9 | 112 |
require( ABSPATH . WPINC . '/class-wp-meta-query.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
113 |
require( ABSPATH . WPINC . '/class-wp-matchesmapregex.php' ); |
0 | 114 |
require( ABSPATH . WPINC . '/class-wp.php' ); |
115 |
require( ABSPATH . WPINC . '/class-wp-error.php' ); |
|
116 |
require( ABSPATH . WPINC . '/pomo/mo.php' ); |
|
117 |
||
118 |
// Include the wpdb class and, if present, a db.php database drop-in. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
119 |
global $wpdb; |
0 | 120 |
require_wp_db(); |
121 |
||
122 |
// Set the database table prefix and the format specifiers for database table columns. |
|
123 |
$GLOBALS['table_prefix'] = $table_prefix; |
|
124 |
wp_set_wpdb_vars(); |
|
125 |
||
126 |
// Start the WordPress object cache, or an external object cache if the drop-in is present. |
|
127 |
wp_start_object_cache(); |
|
128 |
||
129 |
// Attach the default filters. |
|
130 |
require( ABSPATH . WPINC . '/default-filters.php' ); |
|
131 |
||
132 |
// Initialize multisite if enabled. |
|
133 |
if ( is_multisite() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
134 |
require( ABSPATH . WPINC . '/class-wp-site-query.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
135 |
require( ABSPATH . WPINC . '/class-wp-network-query.php' ); |
0 | 136 |
require( ABSPATH . WPINC . '/ms-blogs.php' ); |
137 |
require( ABSPATH . WPINC . '/ms-settings.php' ); |
|
138 |
} elseif ( ! defined( 'MULTISITE' ) ) { |
|
139 |
define( 'MULTISITE', false ); |
|
140 |
} |
|
141 |
||
142 |
register_shutdown_function( 'shutdown_action_hook' ); |
|
143 |
||
144 |
// Stop most of WordPress from being loaded if we just want the basics. |
|
9 | 145 |
if ( SHORTINIT ) { |
0 | 146 |
return false; |
9 | 147 |
} |
0 | 148 |
|
149 |
// Load the L10n library. |
|
150 |
require_once( ABSPATH . WPINC . '/l10n.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
151 |
require_once( ABSPATH . WPINC . '/class-wp-locale.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
require_once( ABSPATH . WPINC . '/class-wp-locale-switcher.php' ); |
0 | 153 |
|
154 |
// Run the installer if WordPress is not installed. |
|
155 |
wp_not_installed(); |
|
156 |
||
157 |
// Load most of WordPress. |
|
158 |
require( ABSPATH . WPINC . '/class-wp-walker.php' ); |
|
159 |
require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); |
|
160 |
require( ABSPATH . WPINC . '/capabilities.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
161 |
require( ABSPATH . WPINC . '/class-wp-roles.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
162 |
require( ABSPATH . WPINC . '/class-wp-role.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
163 |
require( ABSPATH . WPINC . '/class-wp-user.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
164 |
require( ABSPATH . WPINC . '/class-wp-query.php' ); |
0 | 165 |
require( ABSPATH . WPINC . '/query.php' ); |
166 |
require( ABSPATH . WPINC . '/date.php' ); |
|
167 |
require( ABSPATH . WPINC . '/theme.php' ); |
|
168 |
require( ABSPATH . WPINC . '/class-wp-theme.php' ); |
|
169 |
require( ABSPATH . WPINC . '/template.php' ); |
|
170 |
require( ABSPATH . WPINC . '/user.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
171 |
require( ABSPATH . WPINC . '/class-wp-user-query.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
172 |
require( ABSPATH . WPINC . '/class-wp-session-tokens.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
173 |
require( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
174 |
require( ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' ); |
0 | 175 |
require( ABSPATH . WPINC . '/general-template.php' ); |
176 |
require( ABSPATH . WPINC . '/link-template.php' ); |
|
177 |
require( ABSPATH . WPINC . '/author-template.php' ); |
|
178 |
require( ABSPATH . WPINC . '/post.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
require( ABSPATH . WPINC . '/class-walker-page.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
require( ABSPATH . WPINC . '/class-wp-post-type.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
require( ABSPATH . WPINC . '/class-wp-post.php' ); |
0 | 183 |
require( ABSPATH . WPINC . '/post-template.php' ); |
184 |
require( ABSPATH . WPINC . '/revision.php' ); |
|
185 |
require( ABSPATH . WPINC . '/post-formats.php' ); |
|
186 |
require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); |
|
187 |
require( ABSPATH . WPINC . '/category.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
require( ABSPATH . WPINC . '/class-walker-category.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
189 |
require( ABSPATH . WPINC . '/class-walker-category-dropdown.php' ); |
0 | 190 |
require( ABSPATH . WPINC . '/category-template.php' ); |
191 |
require( ABSPATH . WPINC . '/comment.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
require( ABSPATH . WPINC . '/class-wp-comment.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
require( ABSPATH . WPINC . '/class-wp-comment-query.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
require( ABSPATH . WPINC . '/class-walker-comment.php' ); |
0 | 195 |
require( ABSPATH . WPINC . '/comment-template.php' ); |
196 |
require( ABSPATH . WPINC . '/rewrite.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
197 |
require( ABSPATH . WPINC . '/class-wp-rewrite.php' ); |
0 | 198 |
require( ABSPATH . WPINC . '/feed.php' ); |
199 |
require( ABSPATH . WPINC . '/bookmark.php' ); |
|
200 |
require( ABSPATH . WPINC . '/bookmark-template.php' ); |
|
201 |
require( ABSPATH . WPINC . '/kses.php' ); |
|
202 |
require( ABSPATH . WPINC . '/cron.php' ); |
|
203 |
require( ABSPATH . WPINC . '/deprecated.php' ); |
|
204 |
require( ABSPATH . WPINC . '/script-loader.php' ); |
|
205 |
require( ABSPATH . WPINC . '/taxonomy.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
206 |
require( ABSPATH . WPINC . '/class-wp-taxonomy.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
207 |
require( ABSPATH . WPINC . '/class-wp-term.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
208 |
require( ABSPATH . WPINC . '/class-wp-term-query.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
209 |
require( ABSPATH . WPINC . '/class-wp-tax-query.php' ); |
0 | 210 |
require( ABSPATH . WPINC . '/update.php' ); |
211 |
require( ABSPATH . WPINC . '/canonical.php' ); |
|
212 |
require( ABSPATH . WPINC . '/shortcodes.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
213 |
require( ABSPATH . WPINC . '/embed.php' ); |
0 | 214 |
require( ABSPATH . WPINC . '/class-wp-embed.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
require( ABSPATH . WPINC . '/class-oembed.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
216 |
require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); |
0 | 217 |
require( ABSPATH . WPINC . '/media.php' ); |
218 |
require( ABSPATH . WPINC . '/http.php' ); |
|
219 |
require( ABSPATH . WPINC . '/class-http.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
220 |
require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
221 |
require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
222 |
require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
223 |
require( ABSPATH . WPINC . '/class-wp-http-cookie.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
224 |
require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
225 |
require( ABSPATH . WPINC . '/class-wp-http-response.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
226 |
require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
227 |
require( ABSPATH . WPINC . '/class-wp-http-requests-hooks.php' ); |
0 | 228 |
require( ABSPATH . WPINC . '/widgets.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
229 |
require( ABSPATH . WPINC . '/class-wp-widget.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
230 |
require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); |
0 | 231 |
require( ABSPATH . WPINC . '/nav-menu.php' ); |
232 |
require( ABSPATH . WPINC . '/nav-menu-template.php' ); |
|
233 |
require( ABSPATH . WPINC . '/admin-bar.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
234 |
require( ABSPATH . WPINC . '/rest-api.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
235 |
require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
236 |
require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
237 |
require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
238 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
239 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
240 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
241 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
242 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
243 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php' ); |
9 | 244 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
245 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
246 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
247 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
248 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' ); |
9 | 249 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' ); |
250 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php' ); |
|
251 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
252 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' ); |
9 | 253 |
require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
254 |
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
255 |
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
256 |
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
257 |
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
258 |
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' ); |
9 | 259 |
require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' ); |
260 |
require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' ); |
|
261 |
require( ABSPATH . WPINC . '/class-wp-block-type.php' ); |
|
262 |
require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); |
|
263 |
require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); |
|
264 |
require( ABSPATH . WPINC . '/blocks.php' ); |
|
265 |
require( ABSPATH . WPINC . '/blocks/archives.php' ); |
|
266 |
require( ABSPATH . WPINC . '/blocks/block.php' ); |
|
267 |
require( ABSPATH . WPINC . '/blocks/calendar.php' ); |
|
268 |
require( ABSPATH . WPINC . '/blocks/categories.php' ); |
|
269 |
require( ABSPATH . WPINC . '/blocks/latest-comments.php' ); |
|
270 |
require( ABSPATH . WPINC . '/blocks/latest-posts.php' ); |
|
271 |
require( ABSPATH . WPINC . '/blocks/rss.php' ); |
|
272 |
require( ABSPATH . WPINC . '/blocks/search.php' ); |
|
273 |
require( ABSPATH . WPINC . '/blocks/shortcode.php' ); |
|
274 |
require( ABSPATH . WPINC . '/blocks/tag-cloud.php' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
275 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
276 |
$GLOBALS['wp_embed'] = new WP_Embed(); |
0 | 277 |
|
278 |
// Load multisite-specific files. |
|
279 |
if ( is_multisite() ) { |
|
280 |
require( ABSPATH . WPINC . '/ms-functions.php' ); |
|
281 |
require( ABSPATH . WPINC . '/ms-default-filters.php' ); |
|
282 |
require( ABSPATH . WPINC . '/ms-deprecated.php' ); |
|
283 |
} |
|
284 |
||
285 |
// Define constants that rely on the API to obtain the default value. |
|
286 |
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. |
|
287 |
wp_plugin_directory_constants(); |
|
288 |
||
5 | 289 |
$GLOBALS['wp_plugin_paths'] = array(); |
290 |
||
0 | 291 |
// Load must-use plugins. |
292 |
foreach ( wp_get_mu_plugins() as $mu_plugin ) { |
|
293 |
include_once( $mu_plugin ); |
|
9 | 294 |
|
295 |
/** |
|
296 |
* Fires once a single must-use plugin has loaded. |
|
297 |
* |
|
298 |
* @since 5.1.0 |
|
299 |
* |
|
300 |
* @param string $mu_plugin Full path to the plugin's main file. |
|
301 |
*/ |
|
302 |
do_action( 'mu_plugin_loaded', $mu_plugin ); |
|
0 | 303 |
} |
304 |
unset( $mu_plugin ); |
|
305 |
||
306 |
// Load network activated plugins. |
|
307 |
if ( is_multisite() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
308 |
foreach ( wp_get_active_network_plugins() as $network_plugin ) { |
5 | 309 |
wp_register_plugin_realpath( $network_plugin ); |
0 | 310 |
include_once( $network_plugin ); |
9 | 311 |
|
312 |
/** |
|
313 |
* Fires once a single network-activated plugin has loaded. |
|
314 |
* |
|
315 |
* @since 5.1.0 |
|
316 |
* |
|
317 |
* @param string $network_plugin Full path to the plugin's main file. |
|
318 |
*/ |
|
319 |
do_action( 'network_plugin_loaded', $network_plugin ); |
|
0 | 320 |
} |
321 |
unset( $network_plugin ); |
|
322 |
} |
|
323 |
||
324 |
/** |
|
325 |
* Fires once all must-use and network-activated plugins have loaded. |
|
326 |
* |
|
327 |
* @since 2.8.0 |
|
328 |
*/ |
|
329 |
do_action( 'muplugins_loaded' ); |
|
330 |
||
9 | 331 |
if ( is_multisite() ) { |
332 |
ms_cookie_constants(); |
|
333 |
} |
|
0 | 334 |
|
5 | 335 |
// Define constants after multisite is loaded. |
0 | 336 |
wp_cookie_constants(); |
337 |
||
338 |
// Define and enforce our SSL constants |
|
339 |
wp_ssl_constants(); |
|
340 |
||
341 |
// Create common globals. |
|
342 |
require( ABSPATH . WPINC . '/vars.php' ); |
|
343 |
||
344 |
// Make taxonomies and posts available to plugins and themes. |
|
345 |
// @plugin authors: warning: these get registered again on the init hook. |
|
346 |
create_initial_taxonomies(); |
|
347 |
create_initial_post_types(); |
|
348 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
349 |
wp_start_scraping_edited_file_errors(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
350 |
|
0 | 351 |
// Register the default theme directory root |
352 |
register_theme_directory( get_theme_root() ); |
|
353 |
||
9 | 354 |
if ( ! is_multisite() ) { |
355 |
// Handle users requesting a recovery mode link and initiating recovery mode. |
|
356 |
wp_recovery_mode()->initialize(); |
|
357 |
} |
|
358 |
||
0 | 359 |
// Load active plugins. |
5 | 360 |
foreach ( wp_get_active_and_valid_plugins() as $plugin ) { |
361 |
wp_register_plugin_realpath( $plugin ); |
|
0 | 362 |
include_once( $plugin ); |
9 | 363 |
|
364 |
/** |
|
365 |
* Fires once a single activated plugin has loaded. |
|
366 |
* |
|
367 |
* @since 5.1.0 |
|
368 |
* |
|
369 |
* @param string $plugin Full path to the plugin's main file. |
|
370 |
*/ |
|
371 |
do_action( 'plugin_loaded', $plugin ); |
|
5 | 372 |
} |
0 | 373 |
unset( $plugin ); |
374 |
||
375 |
// Load pluggable functions. |
|
376 |
require( ABSPATH . WPINC . '/pluggable.php' ); |
|
377 |
require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); |
|
378 |
||
379 |
// Set internal encoding. |
|
380 |
wp_set_internal_encoding(); |
|
381 |
||
382 |
// Run wp_cache_postload() if object cache is enabled and the function exists. |
|
9 | 383 |
if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { |
0 | 384 |
wp_cache_postload(); |
9 | 385 |
} |
0 | 386 |
|
387 |
/** |
|
388 |
* Fires once activated plugins have loaded. |
|
389 |
* |
|
390 |
* Pluggable functions are also available at this point in the loading order. |
|
391 |
* |
|
5 | 392 |
* @since 1.5.0 |
0 | 393 |
*/ |
394 |
do_action( 'plugins_loaded' ); |
|
395 |
||
396 |
// Define constants which affect functionality if not already defined. |
|
397 |
wp_functionality_constants(); |
|
398 |
||
399 |
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) |
|
400 |
wp_magic_quotes(); |
|
401 |
||
402 |
/** |
|
403 |
* Fires when comment cookies are sanitized. |
|
404 |
* |
|
405 |
* @since 2.0.11 |
|
406 |
*/ |
|
407 |
do_action( 'sanitize_comment_cookies' ); |
|
408 |
||
409 |
/** |
|
410 |
* WordPress Query object |
|
9 | 411 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
412 |
* @global WP_Query $wp_the_query |
0 | 413 |
* @since 2.0.0 |
414 |
*/ |
|
5 | 415 |
$GLOBALS['wp_the_query'] = new WP_Query(); |
0 | 416 |
|
417 |
/** |
|
418 |
* Holds the reference to @see $wp_the_query |
|
419 |
* Use this global for WordPress queries |
|
9 | 420 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
421 |
* @global WP_Query $wp_query |
0 | 422 |
* @since 1.5.0 |
423 |
*/ |
|
5 | 424 |
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; |
0 | 425 |
|
426 |
/** |
|
427 |
* Holds the WordPress Rewrite object for creating pretty URLs |
|
9 | 428 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
* @global WP_Rewrite $wp_rewrite |
0 | 430 |
* @since 1.5.0 |
431 |
*/ |
|
432 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
|
433 |
||
434 |
/** |
|
435 |
* WordPress Object |
|
9 | 436 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
437 |
* @global WP $wp |
0 | 438 |
* @since 2.0.0 |
439 |
*/ |
|
5 | 440 |
$GLOBALS['wp'] = new WP(); |
0 | 441 |
|
442 |
/** |
|
443 |
* WordPress Widget Factory Object |
|
9 | 444 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
445 |
* @global WP_Widget_Factory $wp_widget_factory |
0 | 446 |
* @since 2.8.0 |
447 |
*/ |
|
448 |
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); |
|
449 |
||
450 |
/** |
|
451 |
* WordPress User Roles |
|
9 | 452 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
453 |
* @global WP_Roles $wp_roles |
0 | 454 |
* @since 2.0.0 |
455 |
*/ |
|
456 |
$GLOBALS['wp_roles'] = new WP_Roles(); |
|
457 |
||
458 |
/** |
|
459 |
* Fires before the theme is loaded. |
|
460 |
* |
|
461 |
* @since 2.6.0 |
|
462 |
*/ |
|
463 |
do_action( 'setup_theme' ); |
|
464 |
||
465 |
// Define the template related constants. |
|
9 | 466 |
wp_templating_constants(); |
0 | 467 |
|
468 |
// Load the default text localization domain. |
|
469 |
load_default_textdomain(); |
|
470 |
||
9 | 471 |
$locale = get_locale(); |
0 | 472 |
$locale_file = WP_LANG_DIR . "/$locale.php"; |
9 | 473 |
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { |
0 | 474 |
require( $locale_file ); |
9 | 475 |
} |
0 | 476 |
unset( $locale_file ); |
477 |
||
478 |
/** |
|
479 |
* WordPress Locale object for loading locale domain date and various strings. |
|
9 | 480 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
481 |
* @global WP_Locale $wp_locale |
0 | 482 |
* @since 2.1.0 |
483 |
*/ |
|
484 |
$GLOBALS['wp_locale'] = new WP_Locale(); |
|
485 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
486 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
487 |
* WordPress Locale Switcher object for switching locales. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
488 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
489 |
* @since 4.7.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
490 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
492 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
493 |
$GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
494 |
$GLOBALS['wp_locale_switcher']->init(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
495 |
|
0 | 496 |
// Load the functions for the active theme, for both parent and child theme if applicable. |
9 | 497 |
foreach ( wp_get_active_and_valid_themes() as $theme ) { |
498 |
if ( file_exists( $theme . '/functions.php' ) ) { |
|
499 |
include $theme . '/functions.php'; |
|
500 |
} |
|
0 | 501 |
} |
9 | 502 |
unset( $theme ); |
0 | 503 |
|
504 |
/** |
|
505 |
* Fires after the theme is loaded. |
|
506 |
* |
|
507 |
* @since 3.0.0 |
|
508 |
*/ |
|
509 |
do_action( 'after_setup_theme' ); |
|
510 |
||
511 |
// Set up current user. |
|
5 | 512 |
$GLOBALS['wp']->init(); |
0 | 513 |
|
514 |
/** |
|
515 |
* Fires after WordPress has finished loading but before any headers are sent. |
|
516 |
* |
|
517 |
* Most of WP is loaded at this stage, and the user is authenticated. WP continues |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
518 |
* to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate |
0 | 519 |
* themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). |
520 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
521 |
* If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below. |
0 | 522 |
* |
5 | 523 |
* @since 1.5.0 |
0 | 524 |
*/ |
525 |
do_action( 'init' ); |
|
526 |
||
527 |
// Check site status |
|
528 |
if ( is_multisite() ) { |
|
529 |
if ( true !== ( $file = ms_site_check() ) ) { |
|
530 |
require( $file ); |
|
531 |
die(); |
|
532 |
} |
|
9 | 533 |
unset( $file ); |
0 | 534 |
} |
535 |
||
536 |
/** |
|
537 |
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. |
|
538 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
539 |
* Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for |
0 | 540 |
* users not logged in. |
541 |
* |
|
5 | 542 |
* @link https://codex.wordpress.org/AJAX_in_Plugins |
0 | 543 |
* |
544 |
* @since 3.0.0 |
|
545 |
*/ |
|
546 |
do_action( 'wp_loaded' ); |