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