author | ymh <ymh.work@gmail.com> |
Tue, 27 Sep 2022 16:37:53 +0200 | |
changeset 19 | 3d72ae0968f4 |
parent 18 | be944660c56a |
child 21 | 48c4eec2b7e6 |
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 |
||
16 | 18 |
/** |
19 |
* Version information for the current WordPress release. |
|
20 |
* |
|
5 | 21 |
* 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
|
22 |
* we're including version.php from another installation and don't want |
5 | 23 |
* these values to be overridden if already set. |
16 | 24 |
* |
25 |
* @global string $wp_version The WordPress version string. |
|
26 |
* @global int $wp_db_version WordPress database version. |
|
27 |
* @global string $tinymce_version TinyMCE version. |
|
28 |
* @global string $required_php_version The required PHP version string. |
|
29 |
* @global string $required_mysql_version The required MySQL version string. |
|
30 |
* @global string $wp_local_package Locale code of the package. |
|
5 | 31 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package; |
16 | 33 |
require ABSPATH . WPINC . '/version.php'; |
34 |
require ABSPATH . WPINC . '/load.php'; |
|
35 |
||
36 |
// Check for the required PHP version and for the MySQL extension or a database drop-in. |
|
37 |
wp_check_php_mysql_versions(); |
|
38 |
||
39 |
// Include files required for initialization. |
|
40 |
require ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php'; |
|
41 |
require ABSPATH . WPINC . '/class-wp-fatal-error-handler.php'; |
|
42 |
require ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php'; |
|
43 |
require ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php'; |
|
44 |
require ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php'; |
|
45 |
require ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php'; |
|
46 |
require ABSPATH . WPINC . '/class-wp-recovery-mode.php'; |
|
47 |
require ABSPATH . WPINC . '/error-protection.php'; |
|
48 |
require ABSPATH . WPINC . '/default-constants.php'; |
|
49 |
require_once ABSPATH . WPINC . '/plugin.php'; |
|
0 | 50 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
51 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
52 |
* 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
|
53 |
* 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
|
54 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
* @global int $blog_id |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
56 |
* @since 2.0.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
57 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
global $blog_id; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
60 |
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE. |
0 | 61 |
wp_initial_constants(); |
62 |
||
9 | 63 |
// Make sure we register the shutdown handler for fatal errors as soon as possible. |
64 |
wp_register_fatal_error_handler(); |
|
65 |
||
0 | 66 |
// WordPress calculates offsets from UTC. |
16 | 67 |
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set |
0 | 68 |
date_default_timezone_set( 'UTC' ); |
69 |
||
70 |
// Standardize $_SERVER variables across setups. |
|
71 |
wp_fix_server_vars(); |
|
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 |
*/ |
16 | 93 |
if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) { |
7
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. |
16 | 95 |
include WP_CONTENT_DIR . '/advanced-cache.php'; |
0 | 96 |
|
16 | 97 |
// Re-initialize any hooks added manually by advanced-cache.php. |
7
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. |
|
16 | 107 |
require ABSPATH . WPINC . '/compat.php'; |
108 |
require ABSPATH . WPINC . '/class-wp-list-util.php'; |
|
109 |
require ABSPATH . WPINC . '/formatting.php'; |
|
110 |
require ABSPATH . WPINC . '/meta.php'; |
|
111 |
require ABSPATH . WPINC . '/functions.php'; |
|
112 |
require ABSPATH . WPINC . '/class-wp-meta-query.php'; |
|
113 |
require ABSPATH . WPINC . '/class-wp-matchesmapregex.php'; |
|
114 |
require ABSPATH . WPINC . '/class-wp.php'; |
|
115 |
require ABSPATH . WPINC . '/class-wp-error.php'; |
|
116 |
require ABSPATH . WPINC . '/pomo/mo.php'; |
|
0 | 117 |
|
16 | 118 |
/** |
119 |
* @global wpdb $wpdb WordPress database abstraction object. |
|
120 |
* @since 0.71 |
|
121 |
*/ |
|
122 |
global $wpdb; |
|
0 | 123 |
// Include the wpdb class and, if present, a db.php database drop-in. |
124 |
require_wp_db(); |
|
125 |
||
126 |
// Set the database table prefix and the format specifiers for database table columns. |
|
127 |
$GLOBALS['table_prefix'] = $table_prefix; |
|
128 |
wp_set_wpdb_vars(); |
|
129 |
||
130 |
// Start the WordPress object cache, or an external object cache if the drop-in is present. |
|
131 |
wp_start_object_cache(); |
|
132 |
||
133 |
// Attach the default filters. |
|
16 | 134 |
require ABSPATH . WPINC . '/default-filters.php'; |
0 | 135 |
|
136 |
// Initialize multisite if enabled. |
|
137 |
if ( is_multisite() ) { |
|
16 | 138 |
require ABSPATH . WPINC . '/class-wp-site-query.php'; |
139 |
require ABSPATH . WPINC . '/class-wp-network-query.php'; |
|
140 |
require ABSPATH . WPINC . '/ms-blogs.php'; |
|
141 |
require ABSPATH . WPINC . '/ms-settings.php'; |
|
0 | 142 |
} elseif ( ! defined( 'MULTISITE' ) ) { |
143 |
define( 'MULTISITE', false ); |
|
144 |
} |
|
145 |
||
146 |
register_shutdown_function( 'shutdown_action_hook' ); |
|
147 |
||
148 |
// Stop most of WordPress from being loaded if we just want the basics. |
|
9 | 149 |
if ( SHORTINIT ) { |
0 | 150 |
return false; |
9 | 151 |
} |
0 | 152 |
|
153 |
// Load the L10n library. |
|
16 | 154 |
require_once ABSPATH . WPINC . '/l10n.php'; |
155 |
require_once ABSPATH . WPINC . '/class-wp-locale.php'; |
|
156 |
require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php'; |
|
0 | 157 |
|
158 |
// Run the installer if WordPress is not installed. |
|
159 |
wp_not_installed(); |
|
160 |
||
161 |
// Load most of WordPress. |
|
16 | 162 |
require ABSPATH . WPINC . '/class-wp-walker.php'; |
163 |
require ABSPATH . WPINC . '/class-wp-ajax-response.php'; |
|
164 |
require ABSPATH . WPINC . '/capabilities.php'; |
|
165 |
require ABSPATH . WPINC . '/class-wp-roles.php'; |
|
166 |
require ABSPATH . WPINC . '/class-wp-role.php'; |
|
167 |
require ABSPATH . WPINC . '/class-wp-user.php'; |
|
168 |
require ABSPATH . WPINC . '/class-wp-query.php'; |
|
169 |
require ABSPATH . WPINC . '/query.php'; |
|
170 |
require ABSPATH . WPINC . '/class-wp-date-query.php'; |
|
171 |
require ABSPATH . WPINC . '/theme.php'; |
|
172 |
require ABSPATH . WPINC . '/class-wp-theme.php'; |
|
19 | 173 |
require ABSPATH . WPINC . '/class-wp-theme-json-schema.php'; |
18 | 174 |
require ABSPATH . WPINC . '/class-wp-theme-json.php'; |
175 |
require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php'; |
|
19 | 176 |
require ABSPATH . WPINC . '/global-styles-and-settings.php'; |
18 | 177 |
require ABSPATH . WPINC . '/class-wp-block-template.php'; |
178 |
require ABSPATH . WPINC . '/block-template-utils.php'; |
|
179 |
require ABSPATH . WPINC . '/block-template.php'; |
|
180 |
require ABSPATH . WPINC . '/theme-templates.php'; |
|
16 | 181 |
require ABSPATH . WPINC . '/template.php'; |
18 | 182 |
require ABSPATH . WPINC . '/https-detection.php'; |
183 |
require ABSPATH . WPINC . '/https-migration.php'; |
|
16 | 184 |
require ABSPATH . WPINC . '/class-wp-user-request.php'; |
185 |
require ABSPATH . WPINC . '/user.php'; |
|
186 |
require ABSPATH . WPINC . '/class-wp-user-query.php'; |
|
187 |
require ABSPATH . WPINC . '/class-wp-session-tokens.php'; |
|
188 |
require ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php'; |
|
189 |
require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php'; |
|
190 |
require ABSPATH . WPINC . '/general-template.php'; |
|
191 |
require ABSPATH . WPINC . '/link-template.php'; |
|
192 |
require ABSPATH . WPINC . '/author-template.php'; |
|
18 | 193 |
require ABSPATH . WPINC . '/robots-template.php'; |
16 | 194 |
require ABSPATH . WPINC . '/post.php'; |
195 |
require ABSPATH . WPINC . '/class-walker-page.php'; |
|
196 |
require ABSPATH . WPINC . '/class-walker-page-dropdown.php'; |
|
197 |
require ABSPATH . WPINC . '/class-wp-post-type.php'; |
|
198 |
require ABSPATH . WPINC . '/class-wp-post.php'; |
|
199 |
require ABSPATH . WPINC . '/post-template.php'; |
|
200 |
require ABSPATH . WPINC . '/revision.php'; |
|
201 |
require ABSPATH . WPINC . '/post-formats.php'; |
|
202 |
require ABSPATH . WPINC . '/post-thumbnail-template.php'; |
|
203 |
require ABSPATH . WPINC . '/category.php'; |
|
204 |
require ABSPATH . WPINC . '/class-walker-category.php'; |
|
205 |
require ABSPATH . WPINC . '/class-walker-category-dropdown.php'; |
|
206 |
require ABSPATH . WPINC . '/category-template.php'; |
|
207 |
require ABSPATH . WPINC . '/comment.php'; |
|
208 |
require ABSPATH . WPINC . '/class-wp-comment.php'; |
|
209 |
require ABSPATH . WPINC . '/class-wp-comment-query.php'; |
|
210 |
require ABSPATH . WPINC . '/class-walker-comment.php'; |
|
211 |
require ABSPATH . WPINC . '/comment-template.php'; |
|
212 |
require ABSPATH . WPINC . '/rewrite.php'; |
|
213 |
require ABSPATH . WPINC . '/class-wp-rewrite.php'; |
|
214 |
require ABSPATH . WPINC . '/feed.php'; |
|
215 |
require ABSPATH . WPINC . '/bookmark.php'; |
|
216 |
require ABSPATH . WPINC . '/bookmark-template.php'; |
|
217 |
require ABSPATH . WPINC . '/kses.php'; |
|
218 |
require ABSPATH . WPINC . '/cron.php'; |
|
219 |
require ABSPATH . WPINC . '/deprecated.php'; |
|
220 |
require ABSPATH . WPINC . '/script-loader.php'; |
|
221 |
require ABSPATH . WPINC . '/taxonomy.php'; |
|
222 |
require ABSPATH . WPINC . '/class-wp-taxonomy.php'; |
|
223 |
require ABSPATH . WPINC . '/class-wp-term.php'; |
|
224 |
require ABSPATH . WPINC . '/class-wp-term-query.php'; |
|
225 |
require ABSPATH . WPINC . '/class-wp-tax-query.php'; |
|
226 |
require ABSPATH . WPINC . '/update.php'; |
|
227 |
require ABSPATH . WPINC . '/canonical.php'; |
|
228 |
require ABSPATH . WPINC . '/shortcodes.php'; |
|
229 |
require ABSPATH . WPINC . '/embed.php'; |
|
230 |
require ABSPATH . WPINC . '/class-wp-embed.php'; |
|
231 |
require ABSPATH . WPINC . '/class-wp-oembed.php'; |
|
232 |
require ABSPATH . WPINC . '/class-wp-oembed-controller.php'; |
|
233 |
require ABSPATH . WPINC . '/media.php'; |
|
234 |
require ABSPATH . WPINC . '/http.php'; |
|
19 | 235 |
require ABSPATH . WPINC . '/class-wp-http.php'; |
16 | 236 |
require ABSPATH . WPINC . '/class-wp-http-streams.php'; |
237 |
require ABSPATH . WPINC . '/class-wp-http-curl.php'; |
|
238 |
require ABSPATH . WPINC . '/class-wp-http-proxy.php'; |
|
239 |
require ABSPATH . WPINC . '/class-wp-http-cookie.php'; |
|
240 |
require ABSPATH . WPINC . '/class-wp-http-encoding.php'; |
|
241 |
require ABSPATH . WPINC . '/class-wp-http-response.php'; |
|
242 |
require ABSPATH . WPINC . '/class-wp-http-requests-response.php'; |
|
243 |
require ABSPATH . WPINC . '/class-wp-http-requests-hooks.php'; |
|
244 |
require ABSPATH . WPINC . '/widgets.php'; |
|
245 |
require ABSPATH . WPINC . '/class-wp-widget.php'; |
|
246 |
require ABSPATH . WPINC . '/class-wp-widget-factory.php'; |
|
19 | 247 |
require ABSPATH . WPINC . '/nav-menu-template.php'; |
16 | 248 |
require ABSPATH . WPINC . '/nav-menu.php'; |
249 |
require ABSPATH . WPINC . '/admin-bar.php'; |
|
18 | 250 |
require ABSPATH . WPINC . '/class-wp-application-passwords.php'; |
16 | 251 |
require ABSPATH . WPINC . '/rest-api.php'; |
252 |
require ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php'; |
|
253 |
require ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php'; |
|
254 |
require ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php'; |
|
255 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php'; |
|
256 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php'; |
|
257 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php'; |
|
19 | 258 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-controller.php'; |
16 | 259 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php'; |
260 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php'; |
|
261 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php'; |
|
262 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php'; |
|
263 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php'; |
|
264 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php'; |
|
19 | 265 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-items-controller.php'; |
266 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menus-controller.php'; |
|
267 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-locations-controller.php'; |
|
16 | 268 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php'; |
269 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php'; |
|
270 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php'; |
|
271 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php'; |
|
272 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-types-controller.php'; |
|
273 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php'; |
|
274 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php'; |
|
275 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php'; |
|
276 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php'; |
|
277 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php'; |
|
19 | 278 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php'; |
18 | 279 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php'; |
19 | 280 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-patterns-controller.php'; |
281 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php'; |
|
18 | 282 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php'; |
283 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-site-health-controller.php'; |
|
284 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-sidebars-controller.php'; |
|
285 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widget-types-controller.php'; |
|
286 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widgets-controller.php'; |
|
287 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-templates-controller.php'; |
|
19 | 288 |
require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-url-details-controller.php'; |
16 | 289 |
require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php'; |
290 |
require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php'; |
|
291 |
require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php'; |
|
292 |
require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php'; |
|
293 |
require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php'; |
|
294 |
require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php'; |
|
295 |
require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php'; |
|
18 | 296 |
require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-term-search-handler.php'; |
297 |
require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-format-search-handler.php'; |
|
16 | 298 |
require ABSPATH . WPINC . '/sitemaps.php'; |
299 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps.php'; |
|
300 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-index.php'; |
|
301 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php'; |
|
302 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-registry.php'; |
|
303 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-renderer.php'; |
|
304 |
require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-stylesheet.php'; |
|
305 |
require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-posts.php'; |
|
306 |
require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-taxonomies.php'; |
|
307 |
require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-users.php'; |
|
18 | 308 |
require ABSPATH . WPINC . '/class-wp-block-editor-context.php'; |
16 | 309 |
require ABSPATH . WPINC . '/class-wp-block-type.php'; |
310 |
require ABSPATH . WPINC . '/class-wp-block-pattern-categories-registry.php'; |
|
311 |
require ABSPATH . WPINC . '/class-wp-block-patterns-registry.php'; |
|
312 |
require ABSPATH . WPINC . '/class-wp-block-styles-registry.php'; |
|
313 |
require ABSPATH . WPINC . '/class-wp-block-type-registry.php'; |
|
314 |
require ABSPATH . WPINC . '/class-wp-block.php'; |
|
315 |
require ABSPATH . WPINC . '/class-wp-block-list.php'; |
|
316 |
require ABSPATH . WPINC . '/class-wp-block-parser.php'; |
|
317 |
require ABSPATH . WPINC . '/blocks.php'; |
|
318 |
require ABSPATH . WPINC . '/blocks/index.php'; |
|
18 | 319 |
require ABSPATH . WPINC . '/block-editor.php'; |
16 | 320 |
require ABSPATH . WPINC . '/block-patterns.php'; |
18 | 321 |
require ABSPATH . WPINC . '/class-wp-block-supports.php'; |
19 | 322 |
require ABSPATH . WPINC . '/block-supports/utils.php'; |
18 | 323 |
require ABSPATH . WPINC . '/block-supports/align.php'; |
324 |
require ABSPATH . WPINC . '/block-supports/border.php'; |
|
325 |
require ABSPATH . WPINC . '/block-supports/colors.php'; |
|
326 |
require ABSPATH . WPINC . '/block-supports/custom-classname.php'; |
|
19 | 327 |
require ABSPATH . WPINC . '/block-supports/dimensions.php'; |
18 | 328 |
require ABSPATH . WPINC . '/block-supports/duotone.php'; |
329 |
require ABSPATH . WPINC . '/block-supports/elements.php'; |
|
330 |
require ABSPATH . WPINC . '/block-supports/generated-classname.php'; |
|
331 |
require ABSPATH . WPINC . '/block-supports/layout.php'; |
|
332 |
require ABSPATH . WPINC . '/block-supports/spacing.php'; |
|
333 |
require ABSPATH . WPINC . '/block-supports/typography.php'; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
334 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
$GLOBALS['wp_embed'] = new WP_Embed(); |
0 | 336 |
|
337 |
// Load multisite-specific files. |
|
338 |
if ( is_multisite() ) { |
|
16 | 339 |
require ABSPATH . WPINC . '/ms-functions.php'; |
340 |
require ABSPATH . WPINC . '/ms-default-filters.php'; |
|
341 |
require ABSPATH . WPINC . '/ms-deprecated.php'; |
|
0 | 342 |
} |
343 |
||
344 |
// Define constants that rely on the API to obtain the default value. |
|
345 |
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. |
|
346 |
wp_plugin_directory_constants(); |
|
347 |
||
5 | 348 |
$GLOBALS['wp_plugin_paths'] = array(); |
349 |
||
0 | 350 |
// Load must-use plugins. |
351 |
foreach ( wp_get_mu_plugins() as $mu_plugin ) { |
|
19 | 352 |
$_wp_plugin_file = $mu_plugin; |
16 | 353 |
include_once $mu_plugin; |
19 | 354 |
$mu_plugin = $_wp_plugin_file; // Avoid stomping of the $mu_plugin variable in a plugin. |
9 | 355 |
|
356 |
/** |
|
357 |
* Fires once a single must-use plugin has loaded. |
|
358 |
* |
|
359 |
* @since 5.1.0 |
|
360 |
* |
|
361 |
* @param string $mu_plugin Full path to the plugin's main file. |
|
362 |
*/ |
|
363 |
do_action( 'mu_plugin_loaded', $mu_plugin ); |
|
0 | 364 |
} |
19 | 365 |
unset( $mu_plugin, $_wp_plugin_file ); |
0 | 366 |
|
367 |
// Load network activated plugins. |
|
368 |
if ( is_multisite() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
369 |
foreach ( wp_get_active_network_plugins() as $network_plugin ) { |
5 | 370 |
wp_register_plugin_realpath( $network_plugin ); |
19 | 371 |
|
372 |
$_wp_plugin_file = $network_plugin; |
|
16 | 373 |
include_once $network_plugin; |
19 | 374 |
$network_plugin = $_wp_plugin_file; // Avoid stomping of the $network_plugin variable in a plugin. |
9 | 375 |
|
376 |
/** |
|
377 |
* Fires once a single network-activated plugin has loaded. |
|
378 |
* |
|
379 |
* @since 5.1.0 |
|
380 |
* |
|
381 |
* @param string $network_plugin Full path to the plugin's main file. |
|
382 |
*/ |
|
383 |
do_action( 'network_plugin_loaded', $network_plugin ); |
|
0 | 384 |
} |
19 | 385 |
unset( $network_plugin, $_wp_plugin_file ); |
0 | 386 |
} |
387 |
||
388 |
/** |
|
389 |
* Fires once all must-use and network-activated plugins have loaded. |
|
390 |
* |
|
391 |
* @since 2.8.0 |
|
392 |
*/ |
|
393 |
do_action( 'muplugins_loaded' ); |
|
394 |
||
9 | 395 |
if ( is_multisite() ) { |
396 |
ms_cookie_constants(); |
|
397 |
} |
|
0 | 398 |
|
5 | 399 |
// Define constants after multisite is loaded. |
0 | 400 |
wp_cookie_constants(); |
401 |
||
16 | 402 |
// Define and enforce our SSL constants. |
0 | 403 |
wp_ssl_constants(); |
404 |
||
405 |
// Create common globals. |
|
16 | 406 |
require ABSPATH . WPINC . '/vars.php'; |
0 | 407 |
|
408 |
// Make taxonomies and posts available to plugins and themes. |
|
409 |
// @plugin authors: warning: these get registered again on the init hook. |
|
410 |
create_initial_taxonomies(); |
|
411 |
create_initial_post_types(); |
|
412 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
413 |
wp_start_scraping_edited_file_errors(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
414 |
|
16 | 415 |
// Register the default theme directory root. |
0 | 416 |
register_theme_directory( get_theme_root() ); |
417 |
||
9 | 418 |
if ( ! is_multisite() ) { |
419 |
// Handle users requesting a recovery mode link and initiating recovery mode. |
|
420 |
wp_recovery_mode()->initialize(); |
|
421 |
} |
|
422 |
||
0 | 423 |
// Load active plugins. |
5 | 424 |
foreach ( wp_get_active_and_valid_plugins() as $plugin ) { |
425 |
wp_register_plugin_realpath( $plugin ); |
|
19 | 426 |
|
427 |
$_wp_plugin_file = $plugin; |
|
16 | 428 |
include_once $plugin; |
19 | 429 |
$plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin. |
9 | 430 |
|
431 |
/** |
|
432 |
* Fires once a single activated plugin has loaded. |
|
433 |
* |
|
434 |
* @since 5.1.0 |
|
435 |
* |
|
436 |
* @param string $plugin Full path to the plugin's main file. |
|
437 |
*/ |
|
438 |
do_action( 'plugin_loaded', $plugin ); |
|
5 | 439 |
} |
19 | 440 |
unset( $plugin, $_wp_plugin_file ); |
0 | 441 |
|
442 |
// Load pluggable functions. |
|
16 | 443 |
require ABSPATH . WPINC . '/pluggable.php'; |
444 |
require ABSPATH . WPINC . '/pluggable-deprecated.php'; |
|
0 | 445 |
|
446 |
// Set internal encoding. |
|
447 |
wp_set_internal_encoding(); |
|
448 |
||
449 |
// Run wp_cache_postload() if object cache is enabled and the function exists. |
|
9 | 450 |
if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { |
0 | 451 |
wp_cache_postload(); |
9 | 452 |
} |
0 | 453 |
|
454 |
/** |
|
455 |
* Fires once activated plugins have loaded. |
|
456 |
* |
|
457 |
* Pluggable functions are also available at this point in the loading order. |
|
458 |
* |
|
5 | 459 |
* @since 1.5.0 |
0 | 460 |
*/ |
461 |
do_action( 'plugins_loaded' ); |
|
462 |
||
463 |
// Define constants which affect functionality if not already defined. |
|
464 |
wp_functionality_constants(); |
|
465 |
||
16 | 466 |
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ). |
0 | 467 |
wp_magic_quotes(); |
468 |
||
469 |
/** |
|
470 |
* Fires when comment cookies are sanitized. |
|
471 |
* |
|
472 |
* @since 2.0.11 |
|
473 |
*/ |
|
474 |
do_action( 'sanitize_comment_cookies' ); |
|
475 |
||
476 |
/** |
|
477 |
* WordPress Query object |
|
9 | 478 |
* |
16 | 479 |
* @global WP_Query $wp_the_query WordPress Query object. |
0 | 480 |
* @since 2.0.0 |
481 |
*/ |
|
5 | 482 |
$GLOBALS['wp_the_query'] = new WP_Query(); |
0 | 483 |
|
484 |
/** |
|
485 |
* Holds the reference to @see $wp_the_query |
|
486 |
* Use this global for WordPress queries |
|
9 | 487 |
* |
16 | 488 |
* @global WP_Query $wp_query WordPress Query object. |
0 | 489 |
* @since 1.5.0 |
490 |
*/ |
|
5 | 491 |
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; |
0 | 492 |
|
493 |
/** |
|
494 |
* Holds the WordPress Rewrite object for creating pretty URLs |
|
9 | 495 |
* |
16 | 496 |
* @global WP_Rewrite $wp_rewrite WordPress rewrite component. |
0 | 497 |
* @since 1.5.0 |
498 |
*/ |
|
499 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
|
500 |
||
501 |
/** |
|
502 |
* WordPress Object |
|
9 | 503 |
* |
16 | 504 |
* @global WP $wp Current WordPress environment instance. |
0 | 505 |
* @since 2.0.0 |
506 |
*/ |
|
5 | 507 |
$GLOBALS['wp'] = new WP(); |
0 | 508 |
|
509 |
/** |
|
510 |
* WordPress Widget Factory Object |
|
9 | 511 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
512 |
* @global WP_Widget_Factory $wp_widget_factory |
0 | 513 |
* @since 2.8.0 |
514 |
*/ |
|
515 |
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); |
|
516 |
||
517 |
/** |
|
518 |
* WordPress User Roles |
|
9 | 519 |
* |
16 | 520 |
* @global WP_Roles $wp_roles WordPress role management object. |
0 | 521 |
* @since 2.0.0 |
522 |
*/ |
|
523 |
$GLOBALS['wp_roles'] = new WP_Roles(); |
|
524 |
||
525 |
/** |
|
526 |
* Fires before the theme is loaded. |
|
527 |
* |
|
528 |
* @since 2.6.0 |
|
529 |
*/ |
|
530 |
do_action( 'setup_theme' ); |
|
531 |
||
532 |
// Define the template related constants. |
|
9 | 533 |
wp_templating_constants(); |
0 | 534 |
|
535 |
// Load the default text localization domain. |
|
536 |
load_default_textdomain(); |
|
537 |
||
9 | 538 |
$locale = get_locale(); |
0 | 539 |
$locale_file = WP_LANG_DIR . "/$locale.php"; |
9 | 540 |
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { |
16 | 541 |
require $locale_file; |
9 | 542 |
} |
0 | 543 |
unset( $locale_file ); |
544 |
||
545 |
/** |
|
546 |
* WordPress Locale object for loading locale domain date and various strings. |
|
9 | 547 |
* |
16 | 548 |
* @global WP_Locale $wp_locale WordPress date and time locale object. |
0 | 549 |
* @since 2.1.0 |
550 |
*/ |
|
551 |
$GLOBALS['wp_locale'] = new WP_Locale(); |
|
552 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
553 |
/** |
16 | 554 |
* WordPress Locale Switcher object for switching locales. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
555 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
556 |
* @since 4.7.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
557 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
558 |
* @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
|
559 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
560 |
$GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
561 |
$GLOBALS['wp_locale_switcher']->init(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
562 |
|
0 | 563 |
// Load the functions for the active theme, for both parent and child theme if applicable. |
9 | 564 |
foreach ( wp_get_active_and_valid_themes() as $theme ) { |
565 |
if ( file_exists( $theme . '/functions.php' ) ) { |
|
566 |
include $theme . '/functions.php'; |
|
567 |
} |
|
0 | 568 |
} |
9 | 569 |
unset( $theme ); |
0 | 570 |
|
571 |
/** |
|
572 |
* Fires after the theme is loaded. |
|
573 |
* |
|
574 |
* @since 3.0.0 |
|
575 |
*/ |
|
576 |
do_action( 'after_setup_theme' ); |
|
577 |
||
16 | 578 |
// Create an instance of WP_Site_Health so that Cron events may fire. |
579 |
if ( ! class_exists( 'WP_Site_Health' ) ) { |
|
580 |
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; |
|
581 |
} |
|
582 |
WP_Site_Health::get_instance(); |
|
583 |
||
0 | 584 |
// Set up current user. |
5 | 585 |
$GLOBALS['wp']->init(); |
0 | 586 |
|
587 |
/** |
|
588 |
* Fires after WordPress has finished loading but before any headers are sent. |
|
589 |
* |
|
590 |
* 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
|
591 |
* to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate |
0 | 592 |
* themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). |
593 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
594 |
* If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below. |
0 | 595 |
* |
5 | 596 |
* @since 1.5.0 |
0 | 597 |
*/ |
598 |
do_action( 'init' ); |
|
599 |
||
16 | 600 |
// Check site status. |
0 | 601 |
if ( is_multisite() ) { |
16 | 602 |
$file = ms_site_check(); |
603 |
if ( true !== $file ) { |
|
604 |
require $file; |
|
0 | 605 |
die(); |
606 |
} |
|
9 | 607 |
unset( $file ); |
0 | 608 |
} |
609 |
||
610 |
/** |
|
611 |
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. |
|
612 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
613 |
* Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for |
0 | 614 |
* users not logged in. |
615 |
* |
|
5 | 616 |
* @link https://codex.wordpress.org/AJAX_in_Plugins |
0 | 617 |
* |
618 |
* @since 3.0.0 |
|
619 |
*/ |
|
620 |
do_action( 'wp_loaded' ); |