| @@ -1,9 +1,24 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit; | |
| 5 | +} | |
| 6 | + | |
| 2 | 7 | function pd_maybe_require( $path ) { |
| 3 | 8 | if ( file_exists( $path ) ) { |
| 4 | - require $path; | |
| 9 | + require_once $path; | |
| 5 | 10 | } |
| 11 | + | |
| 12 | + // class-settings.php is included from inside a static method, so vars | |
| 13 | + // set at script scope by required files (notably wp-includes/version.php) | |
| 14 | + // land here as locals instead of in $GLOBALS. Promote the known set so | |
| 15 | + // core functions like wp_check_php_mysql_versions() can read them. | |
| 16 | + foreach ( array( 'wp_version', 'wp_db_version', 'tinymce_version', 'required_php_version', 'required_php_extensions', 'required_mysql_version', 'wp_local_package' ) as $name ) { | |
| 17 | + if ( isset( $$name ) ) { | |
| 18 | + $GLOBALS[ $name ] = $$name; | |
| 19 | + } | |
| 20 | + } | |
| 6 | 21 | } |
| 7 | 22 | /** |
| 8 | 23 | * Troubleshoot Settings. |
| 9 | 24 | * |
| @@ -63,11 +78,35 @@ | ||
| 63 | 78 | * @since 1.0.0 |
| 64 | 79 | */ |
| 65 | 80 | define( 'WPINC', 'wp-includes' ); |
| 66 | 81 | |
| 82 | +/** | |
| 83 | + * Version information for the current WordPress release. | |
| 84 | + * | |
| 85 | + * These can't be directly globalized in version.php. When updating, | |
| 86 | + * include version.php from another installation and don't override | |
| 87 | + * these values if already set. | |
| 88 | + * | |
| 89 | + * @global string $wp_version The WordPress version string. | |
| 90 | + * @global int $wp_db_version WordPress database version. | |
| 91 | + * @global string $tinymce_version TinyMCE version. | |
| 92 | + * @global string $required_php_version The minimum required PHP version string. | |
| 93 | + * @global string[] $required_php_extensions The names of required PHP extensions. | |
| 94 | + * @global string $required_mysql_version The minimum required MySQL version string. | |
| 95 | + * @global string $wp_local_package Locale code of the package. | |
| 96 | + */ | |
| 97 | +global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wp_local_package; | |
| 98 | +pd_maybe_require( ABSPATH . WPINC . '/version.php' ); | |
| 99 | +pd_maybe_require( ABSPATH . WPINC . '/compat-utf8.php' ); | |
| 100 | +pd_maybe_require( ABSPATH . WPINC . '/compat.php' ); | |
| 101 | +pd_maybe_require( ABSPATH . WPINC . '/load.php' ); | |
| 102 | + | |
| 103 | +// Check the server requirements. | |
| 104 | +// wp_check_php_mysql_versions(); | |
| 105 | + | |
| 67 | 106 | // Include files required for initialization. |
| 68 | -pd_maybe_require( ABSPATH . WPINC . '/load.php' ); | |
| 69 | 107 | @include( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' ); |
| 108 | +@include( ABSPATH . WPINC . '/class-wp-exception.php' ); | |
| 70 | 109 | @include( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' ); |
| 71 | 110 | @include( ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php' ); |
| 72 | 111 | @include( ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php' ); |
| 73 | 112 | @include( ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php' ); |
| @@ -76,16 +115,8 @@ | ||
| 76 | 115 | @include( ABSPATH . WPINC . '/error-protection.php' ); |
| 77 | 116 | @include( ABSPATH . WPINC . '/default-constants.php' ); |
| 78 | 117 | require_once( ABSPATH . WPINC . '/plugin.php' ); |
| 79 | 118 | |
| 80 | -/* | |
| 81 | - * These can't be directly globalized in version.php. When updating, | |
| 82 | - * we're including version.php from another installation and don't want | |
| 83 | - * these values to be overridden if already set. | |
| 84 | - */ | |
| 85 | -global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package; | |
| 86 | -pd_maybe_require( ABSPATH . WPINC . '/version.php' ); | |
| 87 | - | |
| 88 | 119 | /** |
| 89 | 120 | * If not already configured, `$blog_id` will default to 1 in a single site |
| 90 | 121 | * configuration. In multisite, it will be overridden by default in ms-settings.php. |
| 91 | 122 | * |
| @@ -106,12 +137,13 @@ | ||
| 106 | 137 | // Check for the required PHP version and for the MySQL extension or a database drop-in. |
| 107 | 138 | wp_check_php_mysql_versions(); |
| 108 | 139 | |
| 109 | 140 | // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. |
| 110 | -@ini_set( 'magic_quotes_runtime', 0 ); | |
| 111 | -@ini_set( 'magic_quotes_sybase', 0 ); | |
| 141 | +@ini_set( 'magic_quotes_runtime', 0 ); // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged -- Vendored WordPress core loader (wp-settings.php). | |
| 142 | +@ini_set( 'magic_quotes_sybase', 0 ); // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged -- Vendored WordPress core loader (wp-settings.php). | |
| 112 | 143 | |
| 113 | 144 | // WordPress calculates offsets from UTC. |
| 145 | +// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set | |
| 114 | 146 | date_default_timezone_set( 'UTC' ); |
| 115 | 147 | |
| 116 | 148 | // Standardize $_SERVER variables across setups. |
| 117 | 149 | wp_fix_server_vars(); |
| @@ -155,21 +187,44 @@ | ||
| 155 | 187 | // Define WP_LANG_DIR if not set. |
| 156 | 188 | wp_set_lang_dir(); |
| 157 | 189 | |
| 158 | 190 | // Load early WordPress files. |
| 159 | -pd_maybe_require( ABSPATH . WPINC . '/compat.php' ); | |
| 160 | 191 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-list-util.php' ); |
| 192 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-token-map.php' ); | |
| 193 | +pd_maybe_require( ABSPATH . WPINC . '/utf8.php' ); | |
| 194 | +pd_maybe_require( ABSPATH . WPINC . '/formatting.php' ); | |
| 195 | +pd_maybe_require( ABSPATH . WPINC . '/meta.php' ); | |
| 161 | 196 | pd_maybe_require( ABSPATH . WPINC . '/functions.php' ); |
| 197 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-meta-query.php' ); | |
| 162 | 198 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-matchesmapregex.php' ); |
| 163 | 199 | pd_maybe_require( ABSPATH . WPINC . '/class-wp.php' ); |
| 164 | 200 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-error.php' ); |
| 165 | 201 | pd_maybe_require( ABSPATH . WPINC . '/pomo/mo.php' ); |
| 202 | +pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-controller.php' ); | |
| 203 | +pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translations.php' ); | |
| 204 | +pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file.php' ); | |
| 205 | +pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file-mo.php' ); | |
| 206 | +pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file-php.php' ); | |
| 166 | 207 | |
| 208 | +/** | |
| 209 | + * @since 0.71 | |
| 210 | + * | |
| 211 | + * @global wpdb $wpdb WordPress database abstraction object. | |
| 212 | + */ | |
| 213 | +global $wpdb; | |
| 167 | 214 | // Include the wpdb class and, if present, a db.php database drop-in. |
| 168 | -global $wpdb; | |
| 169 | 215 | require_wp_db(); |
| 216 | + | |
| 217 | +/** | |
| 218 | + * @since 3.3.0 | |
| 219 | + * | |
| 220 | + * @global string $table_prefix The database table prefix. | |
| 221 | + */ | |
| 222 | +if ( ! isset( $GLOBALS['table_prefix'] ) ) { | |
| 223 | + $GLOBALS['table_prefix'] = $table_prefix; | |
| 224 | +} | |
| 225 | + | |
| 170 | 226 | // Set the database table prefix and the format specifiers for database table columns. |
| 171 | -$GLOBALS['table_prefix'] = $table_prefix; | |
| 172 | 227 | wp_set_wpdb_vars(); |
| 173 | 228 | |
| 174 | 229 | // Start the WordPress object cache, or an external object cache if the drop-in is present. |
| 175 | 230 | wp_start_object_cache(); |
| @@ -193,11 +248,12 @@ | ||
| 193 | 248 | if ( SHORTINIT ) |
| 194 | 249 | return false; |
| 195 | 250 | |
| 196 | 251 | // Load the L10n library. |
| 197 | -require_once( ABSPATH . WPINC . '/l10n.php' ); | |
| 198 | -require_once( ABSPATH . WPINC . '/class-wp-locale.php' ); | |
| 199 | -require_once( ABSPATH . WPINC . '/class-wp-locale-switcher.php' ); | |
| 252 | +pd_maybe_require( ABSPATH . WPINC . '/l10n.php' ); | |
| 253 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-textdomain-registry.php' ); | |
| 254 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-locale.php' ); | |
| 255 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-locale-switcher.php' ); | |
| 200 | 256 | |
| 201 | 257 | // Run the installer if WordPress is not installed. |
| 202 | 258 | /* PD: Start wp_not_installed() disable */ |
| 203 | 259 | |
| @@ -208,9 +264,8 @@ | ||
| 208 | 264 | |
| 209 | 265 | // Load most of WordPress. |
| 210 | 266 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-walker.php' ); |
| 211 | 267 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); |
| 212 | -pd_maybe_require( ABSPATH . WPINC . '/formatting.php' ); | |
| 213 | 268 | pd_maybe_require( ABSPATH . WPINC . '/capabilities.php' ); |
| 214 | 269 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-roles.php' ); |
| 215 | 270 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-role.php' ); |
| 216 | 271 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user.php' ); |
| @@ -216,11 +271,29 @@ | ||
| 216 | 271 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user.php' ); |
| 217 | 272 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-query.php' ); |
| 218 | 273 | pd_maybe_require( ABSPATH . WPINC . '/query.php' ); |
| 219 | 274 | pd_maybe_require( ABSPATH . WPINC . '/date.php' ); |
| 275 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-date-query.php' ); | |
| 220 | 276 | pd_maybe_require( ABSPATH . WPINC . '/theme.php' ); |
| 221 | 277 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme.php' ); |
| 278 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json-schema.php' ); | |
| 279 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json-data.php' ); | |
| 280 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json.php' ); | |
| 281 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json-resolver.php' ); | |
| 282 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-duotone.php' ); | |
| 283 | +pd_maybe_require( ABSPATH . WPINC . '/global-styles-and-settings.php' ); | |
| 284 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-template.php' ); | |
| 285 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-templates-registry.php' ); | |
| 286 | +pd_maybe_require( ABSPATH . WPINC . '/block-template-utils.php' ); | |
| 287 | +pd_maybe_require( ABSPATH . WPINC . '/block-template.php' ); | |
| 288 | +pd_maybe_require( ABSPATH . WPINC . '/theme-templates.php' ); | |
| 289 | +pd_maybe_require( ABSPATH . WPINC . '/theme-previews.php' ); | |
| 222 | 290 | pd_maybe_require( ABSPATH . WPINC . '/template.php' ); |
| 291 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-view-config-data.php' ); | |
| 292 | +pd_maybe_require( ABSPATH . WPINC . '/view-config.php' ); | |
| 293 | +pd_maybe_require( ABSPATH . WPINC . '/https-detection.php' ); | |
| 294 | +pd_maybe_require( ABSPATH . WPINC . '/https-migration.php' ); | |
| 295 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-user-request.php' ); | |
| 223 | 296 | pd_maybe_require( ABSPATH . WPINC . '/user.php' ); |
| 224 | 297 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user-query.php' ); |
| 225 | 298 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-session-tokens.php' ); |
| 226 | 299 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' ); |
| @@ -231,8 +304,9 @@ | ||
| 231 | 304 | pd_maybe_require( ABSPATH . WPINC . '/link-template.php' ); |
| 232 | 305 | |
| 233 | 306 | |
| 234 | 307 | pd_maybe_require( ABSPATH . WPINC . '/author-template.php' ); |
| 308 | +pd_maybe_require( ABSPATH . WPINC . '/robots-template.php' ); | |
| 235 | 309 | pd_maybe_require( ABSPATH . WPINC . '/post.php' ); |
| 236 | 310 | pd_maybe_require( ABSPATH . WPINC . '/class-walker-page.php' ); |
| 237 | 311 | pd_maybe_require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); |
| 238 | 312 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-post-type.php' ); |
| @@ -258,8 +332,10 @@ | ||
| 258 | 332 | pd_maybe_require( ABSPATH . WPINC . '/kses.php' ); |
| 259 | 333 | pd_maybe_require( ABSPATH . WPINC . '/cron.php' ); |
| 260 | 334 | pd_maybe_require( ABSPATH . WPINC . '/deprecated.php' ); |
| 261 | 335 | pd_maybe_require( ABSPATH . WPINC . '/script-loader.php' ); |
| 336 | +pd_maybe_require( ABSPATH . WPINC . '/build/routes.php' ); | |
| 337 | +pd_maybe_require( ABSPATH . WPINC . '/build/pages.php' ); | |
| 262 | 338 | pd_maybe_require( ABSPATH . WPINC . '/taxonomy.php' ); |
| 263 | 339 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-taxonomy.php' ); |
| 264 | 340 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-term.php' ); |
| 265 | 341 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-term-query.php' ); |
| @@ -269,12 +345,32 @@ | ||
| 269 | 345 | pd_maybe_require( ABSPATH . WPINC . '/shortcodes.php' ); |
| 270 | 346 | pd_maybe_require( ABSPATH . WPINC . '/embed.php' ); |
| 271 | 347 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-embed.php' ); |
| 272 | 348 | pd_maybe_require( ABSPATH . WPINC . '/class-oembed.php' ); |
| 349 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-oembed.php' ); | |
| 273 | 350 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); |
| 274 | 351 | pd_maybe_require( ABSPATH . WPINC . '/media.php' ); |
| 275 | 352 | pd_maybe_require( ABSPATH . WPINC . '/http.php' ); |
| 276 | 353 | pd_maybe_require( ABSPATH . WPINC . '/class-http.php' ); |
| 354 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/html5-named-character-references.php' ); | |
| 355 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-attribute-token.php' ); | |
| 356 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-span.php' ); | |
| 357 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-doctype-info.php' ); | |
| 358 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-text-replacement.php' ); | |
| 359 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-decoder.php' ); | |
| 360 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-tag-processor.php' ); | |
| 361 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-unsupported-exception.php' ); | |
| 362 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-active-formatting-elements.php' ); | |
| 363 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-open-elements.php' ); | |
| 364 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-token.php' ); | |
| 365 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-stack-event.php' ); | |
| 366 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-processor-state.php' ); | |
| 367 | +pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-processor.php' ); | |
| 368 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-processor.php' ); | |
| 369 | +if ( ! class_exists( 'WP_Block_Processor' ) ) { | |
| 370 | + pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-block-processor.php' ); | |
| 371 | +} | |
| 372 | +// pd_maybe_require( ABSPATH . WPINC . '/class-wp-http.php' ); // fatal error if both are here. class-http is better for backcompat. class-wp-http was introduced in 5.9 | |
| 277 | 373 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); |
| 278 | 374 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); |
| 279 | 375 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); |
| 280 | 376 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-cookie.php' ); |
| @@ -281,15 +377,40 @@ | ||
| 281 | 377 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); |
| 282 | 378 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-response.php' ); |
| 283 | 379 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); |
| 284 | 380 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-requests-hooks.php' ); |
| 381 | +pd_maybe_require( ABSPATH . WPINC . '/php-ai-client/autoload.php' ); | |
| 382 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-http-client.php' ); | |
| 383 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-cache.php' ); | |
| 384 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-discovery-strategy.php' ); | |
| 385 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-event-dispatcher.php' ); | |
| 386 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/class-wp-ai-client-ability-function-resolver.php' ); | |
| 387 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client/class-wp-ai-client-prompt-builder.php' ); | |
| 388 | +pd_maybe_require( ABSPATH . WPINC . '/ai-client.php' ); | |
| 389 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-connector-registry.php' ); | |
| 390 | +pd_maybe_require( ABSPATH . WPINC . '/connectors.php' ); | |
| 391 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-icon-collections-registry.php' ); | |
| 392 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-icons-registry.php' ); | |
| 393 | +pd_maybe_require( ABSPATH . WPINC . '/icons.php' ); | |
| 285 | 394 | pd_maybe_require( ABSPATH . WPINC . '/widgets.php' ); |
| 286 | 395 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-widget.php' ); |
| 287 | 396 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); |
| 397 | +pd_maybe_require( ABSPATH . WPINC . '/nav-menu-template.php' ); | |
| 288 | 398 | pd_maybe_require( ABSPATH . WPINC . '/nav-menu.php' ); |
| 289 | -pd_maybe_require( ABSPATH . WPINC . '/nav-menu-template.php' ); | |
| 290 | 399 | pd_maybe_require( ABSPATH . WPINC . '/admin-bar.php' ); |
| 400 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-application-passwords.php' ); | |
| 401 | +pd_maybe_require( ABSPATH . WPINC . '/abilities-api/class-wp-ability-category.php' ); | |
| 402 | +pd_maybe_require( ABSPATH . WPINC . '/abilities-api/class-wp-ability-categories-registry.php' ); | |
| 403 | +pd_maybe_require( ABSPATH . WPINC . '/abilities-api/class-wp-ability.php' ); | |
| 404 | +pd_maybe_require( ABSPATH . WPINC . '/abilities-api/class-wp-abilities-registry.php' ); | |
| 405 | +pd_maybe_require( ABSPATH . WPINC . '/abilities-api.php' ); | |
| 406 | +pd_maybe_require( ABSPATH . WPINC . '/abilities.php' ); | |
| 407 | +pd_maybe_require( ABSPATH . WPINC . '/collaboration/interface-wp-sync-storage.php' ); | |
| 408 | +pd_maybe_require( ABSPATH . WPINC . '/collaboration/class-wp-sync-post-meta-storage.php' ); | |
| 409 | +pd_maybe_require( ABSPATH . WPINC . '/collaboration/class-wp-http-polling-sync-server.php' ); | |
| 410 | +pd_maybe_require( ABSPATH . WPINC . '/collaboration.php' ); | |
| 291 | 411 | pd_maybe_require( ABSPATH . WPINC . '/rest-api.php' ); |
| 412 | +pd_maybe_require( ABSPATH . WPINC . '/json-schema.php' ); | |
| 292 | 413 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); |
| 293 | 414 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); |
| 294 | 415 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); |
| 295 | 416 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' ); |
| @@ -294,14 +415,21 @@ | ||
| 294 | 415 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); |
| 295 | 416 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' ); |
| 296 | 417 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php' ); |
| 297 | 418 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php' ); |
| 419 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-controller.php' ); | |
| 298 | 420 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php' ); |
| 299 | 421 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php' ); |
| 300 | 422 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php' ); |
| 423 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php' ); | |
| 424 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-template-revisions-controller.php' ); | |
| 301 | 425 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php' ); |
| 426 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php' ); | |
| 302 | 427 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php' ); |
| 303 | 428 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php' ); |
| 429 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-items-controller.php' ); | |
| 430 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menus-controller.php' ); | |
| 431 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-locations-controller.php' ); | |
| 304 | 432 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' ); |
| 305 | 433 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' ); |
| 306 | 434 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' ); |
| 307 | 435 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php' ); |
| @@ -310,8 +438,29 @@ | ||
| 310 | 438 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' ); |
| 311 | 439 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' ); |
| 312 | 440 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php' ); |
| 313 | 441 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php' ); |
| 442 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php' ); | |
| 443 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php' ); | |
| 444 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-patterns-controller.php' ); | |
| 445 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php' ); | |
| 446 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php' ); | |
| 447 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-site-health-controller.php' ); | |
| 448 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-sidebars-controller.php' ); | |
| 449 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widget-types-controller.php' ); | |
| 450 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widgets-controller.php' ); | |
| 451 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-templates-controller.php' ); | |
| 452 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-url-details-controller.php' ); | |
| 453 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php' ); | |
| 454 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-families-controller.php' ); | |
| 455 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-faces-controller.php' ); | |
| 456 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-collections-controller.php' ); | |
| 457 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-icons-controller.php' ); | |
| 458 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-icon-collections-controller.php' ); | |
| 459 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-view-config-controller.php' ); | |
| 460 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-categories-controller.php' ); | |
| 461 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php' ); | |
| 462 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php' ); | |
| 314 | 463 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' ); |
| 315 | 464 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' ); |
| 316 | 465 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' ); |
| 317 | 466 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' ); |
| @@ -318,8 +467,10 @@ | ||
| 318 | 467 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' ); |
| 319 | 468 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' ); |
| 320 | 469 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' ); |
| 321 | 470 | |
| 471 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-term-search-handler.php' ); | |
| 472 | +pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-format-search-handler.php' ); | |
| 322 | 473 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps.php' ); |
| 323 | 474 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps.php' ); |
| 324 | 475 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-index.php' ); |
| 325 | 476 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php' ); |
| @@ -328,9 +479,13 @@ | ||
| 328 | 479 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-stylesheet.php' ); |
| 329 | 480 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-posts.php' ); |
| 330 | 481 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-taxonomies.php' ); |
| 331 | 482 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-users.php' ); |
| 483 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-bindings-source.php' ); | |
| 484 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-bindings-registry.php' ); | |
| 485 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-editor-context.php' ); | |
| 332 | 486 | |
| 487 | + | |
| 333 | 488 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-type.php' ); |
| 334 | 489 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-pattern-categories-registry.php' ); |
| 335 | 490 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-patterns-registry.php' ); |
| 336 | 491 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-styles-registry.php' ); |
| @@ -336,18 +491,99 @@ | ||
| 336 | 491 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-styles-registry.php' ); |
| 337 | 492 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); |
| 338 | 493 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block.php' ); |
| 339 | 494 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-list.php' ); |
| 495 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-metadata-registry.php' ); | |
| 496 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-parser-block.php' ); | |
| 497 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-parser-frame.php' ); | |
| 340 | 498 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); |
| 499 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-classic-to-block-menu-converter.php' ); | |
| 500 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-navigation-fallback.php' ); | |
| 501 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings.php' ); | |
| 502 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/pattern-overrides.php' ); | |
| 503 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/post-data.php' ); | |
| 504 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/post-meta.php' ); | |
| 505 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/term-data.php' ); | |
| 341 | 506 | pd_maybe_require( ABSPATH . WPINC . '/blocks.php' ); |
| 342 | 507 | pd_maybe_require( ABSPATH . WPINC . '/blocks/index.php' ); |
| 508 | +pd_maybe_require( ABSPATH . WPINC . '/block-editor.php' ); | |
| 343 | 509 | pd_maybe_require( ABSPATH . WPINC . '/block-patterns.php' ); |
| 510 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-supports.php' ); | |
| 511 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/utils.php' ); | |
| 512 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/align.php' ); | |
| 513 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/custom-classname.php' ); | |
| 514 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/generated-classname.php' ); | |
| 515 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/settings.php' ); | |
| 516 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/elements.php' ); | |
| 517 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/colors.php' ); | |
| 518 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/typography.php' ); | |
| 519 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/border.php' ); | |
| 520 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/layout.php' ); | |
| 521 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/position.php' ); | |
| 522 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/spacing.php' ); | |
| 523 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/dimensions.php' ); | |
| 524 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/duotone.php' ); | |
| 525 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/shadow.php' ); | |
| 526 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/background.php' ); | |
| 527 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/block-style-variations.php' ); | |
| 528 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/aria-label.php' ); | |
| 529 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/block-visibility.php' ); | |
| 530 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/anchor.php' ); | |
| 531 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/custom-css.php' ); | |
| 532 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/states.php' ); | |
| 533 | +pd_maybe_require( ABSPATH . WPINC . '/block-supports/auto-register.php' ); | |
| 534 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine.php' ); | |
| 535 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine.php' ); | |
| 536 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-declarations.php' ); | |
| 537 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-rule.php' ); | |
| 538 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-rules-store.php' ); | |
| 539 | +pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-processor.php' ); | |
| 540 | +pd_maybe_require( ABSPATH . WPINC . '/fonts/class-wp-font-face-resolver.php' ); | |
| 541 | +pd_maybe_require( ABSPATH . WPINC . '/fonts/class-wp-font-collection.php' ); | |
| 542 | +pd_maybe_require( ABSPATH . WPINC . '/fonts/class-wp-font-face.php' ); | |
| 543 | +pd_maybe_require( ABSPATH . WPINC . '/fonts/class-wp-font-library.php' ); | |
| 544 | +pd_maybe_require( ABSPATH . WPINC . '/fonts/class-wp-font-utils.php' ); | |
| 545 | +pd_maybe_require( ABSPATH . WPINC . '/fonts.php' ); | |
| 546 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-script-modules.php' ); | |
| 547 | +pd_maybe_require( ABSPATH . WPINC . '/script-modules.php' ); | |
| 548 | +pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api.php' ); | |
| 549 | +pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api-directives-processor.php' ); | |
| 550 | +pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/interactivity-api.php' ); | |
| 551 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-plugin-dependencies.php' ); | |
| 552 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-url-pattern-prefixer.php' ); | |
| 553 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-speculation-rules.php' ); | |
| 554 | +pd_maybe_require( ABSPATH . WPINC . '/speculative-loading.php' ); | |
| 555 | +pd_maybe_require( ABSPATH . WPINC . '/view-transitions.php' ); | |
| 344 | 556 | |
| 557 | +if ( function_exists( 'wp_script_modules' ) ) { | |
| 558 | + add_action( 'after_setup_theme', array( wp_script_modules(), 'add_hooks' ) ); | |
| 559 | +} | |
| 560 | +if ( function_exists( 'wp_interactivity' ) ) { | |
| 561 | + add_action( 'after_setup_theme', array( wp_interactivity(), 'add_hooks' ) ); | |
| 562 | +} | |
| 563 | + | |
| 345 | 564 | /* PD: Start bail out early */ |
| 346 | 565 | // return; |
| 347 | 566 | /* PD: End bail out early */ |
| 348 | 567 | $GLOBALS['wp_embed'] = new WP_Embed(); |
| 349 | 568 | |
| 569 | +/** | |
| 570 | + * WordPress Textdomain Registry object. | |
| 571 | + * | |
| 572 | + * Used to support just-in-time translations for manually loaded text domains. | |
| 573 | + * | |
| 574 | + * @since 6.1.0 | |
| 575 | + * | |
| 576 | + * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. | |
| 577 | + */ | |
| 578 | +if ( class_exists( '\WP_Textdomain_Registry' ) ) { | |
| 579 | + $GLOBALS['wp_textdomain_registry'] = new WP_Textdomain_Registry(); | |
| 580 | + if( method_exists( $GLOBALS['wp_textdomain_registry'], 'init' ) ) { | |
| 581 | + // introduced in WP6.5 | |
| 582 | + $GLOBALS['wp_textdomain_registry']->init(); | |
| 583 | + } | |
| 584 | +} | |
| 585 | + | |
| 350 | 586 | // Load multisite-specific files. |
| 351 | 587 | if ( is_multisite() ) { |
| 352 | 588 | pd_maybe_require( ABSPATH . WPINC . '/ms-functions.php' ); |
| 353 | 589 | pd_maybe_require( ABSPATH . WPINC . '/ms-default-filters.php' ); |
| @@ -361,19 +597,42 @@ | ||
| 361 | 597 | $GLOBALS['wp_plugin_paths'] = array(); |
| 362 | 598 | |
| 363 | 599 | // Load must-use plugins. |
| 364 | 600 | foreach ( wp_get_mu_plugins() as $mu_plugin ) { |
| 365 | - include_once( $mu_plugin ); | |
| 601 | + $_wp_plugin_file = $mu_plugin; | |
| 602 | + include_once $mu_plugin; | |
| 603 | + $mu_plugin = $_wp_plugin_file; // Avoid stomping of the $mu_plugin variable in a plugin. | |
| 604 | + | |
| 605 | + /** | |
| 606 | + * Fires once a single must-use plugin has loaded. | |
| 607 | + * | |
| 608 | + * @since 5.1.0 | |
| 609 | + * | |
| 610 | + * @param string $mu_plugin Full path to the plugin's main file. | |
| 611 | + */ | |
| 612 | + do_action( 'mu_plugin_loaded', $mu_plugin ); | |
| 366 | 613 | } |
| 367 | -unset( $mu_plugin ); | |
| 614 | +unset( $mu_plugin, $_wp_plugin_file ); | |
| 368 | 615 | |
| 369 | 616 | // Load network activated plugins. |
| 370 | 617 | if ( is_multisite() ) { |
| 371 | 618 | foreach ( wp_get_active_network_plugins() as $network_plugin ) { |
| 372 | 619 | wp_register_plugin_realpath( $network_plugin ); |
| 373 | - include_once( $network_plugin ); | |
| 620 | + | |
| 621 | + $_wp_plugin_file = $network_plugin; | |
| 622 | + include_once $network_plugin; | |
| 623 | + $network_plugin = $_wp_plugin_file; // Avoid stomping of the $network_plugin variable in a plugin. | |
| 624 | + | |
| 625 | + /** | |
| 626 | + * Fires once a single network-activated plugin has loaded. | |
| 627 | + * | |
| 628 | + * @since 5.1.0 | |
| 629 | + * | |
| 630 | + * @param string $network_plugin Full path to the plugin's main file. | |
| 631 | + */ | |
| 632 | + do_action( 'network_plugin_loaded', $network_plugin ); | |
| 374 | 633 | } |
| 375 | - unset( $network_plugin ); | |
| 634 | + unset( $network_plugin, $_wp_plugin_file ); | |
| 376 | 635 | } |
| 377 | 636 | |
| 378 | 637 | /** |
| 379 | 638 | * Fires once all must-use and network-activated plugins have loaded. |
| @@ -381,10 +640,11 @@ | ||
| 381 | 640 | * @since 2.8.0 |
| 382 | 641 | */ |
| 383 | 642 | do_action( 'muplugins_loaded' ); |
| 384 | 643 | |
| 385 | -if ( is_multisite() ) | |
| 386 | - ms_cookie_constants( ); | |
| 644 | +if ( is_multisite() ) { | |
| 645 | + ms_cookie_constants(); | |
| 646 | +} | |
| 387 | 647 | |
| 388 | 648 | // Define constants after multisite is loaded. |
| 389 | 649 | wp_cookie_constants(); |
| 390 | 650 | |
| @@ -416,8 +676,46 @@ | ||
| 416 | 676 | // unset( $plugin ); |
| 417 | 677 | |
| 418 | 678 | /* PD: End cache disable */ |
| 419 | 679 | |
| 680 | +// if ( ! is_multisite() && wp_is_fatal_error_handler_enabled() ) { | |
| 681 | +// // Handle users requesting a recovery mode link and initiating recovery mode. | |
| 682 | +// wp_recovery_mode()->initialize(); | |
| 683 | +// } | |
| 684 | + | |
| 685 | +// // To make get_plugin_data() available in a way that's compatible with plugins also loading this file, see #62244. | |
| 686 | +// require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 687 | + | |
| 688 | +// // Load active plugins. | |
| 689 | +// foreach ( wp_get_active_and_valid_plugins() as $plugin ) { | |
| 690 | +// wp_register_plugin_realpath( $plugin ); | |
| 691 | + | |
| 692 | +// $plugin_data = get_plugin_data( $plugin, false, false ); | |
| 693 | + | |
| 694 | +// $textdomain = $plugin_data['TextDomain']; | |
| 695 | +// if ( $textdomain ) { | |
| 696 | +// if ( $plugin_data['DomainPath'] ) { | |
| 697 | +// $GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $plugin ) . $plugin_data['DomainPath'] ); | |
| 698 | +// } else { | |
| 699 | +// $GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $plugin ) ); | |
| 700 | +// } | |
| 701 | +// } | |
| 702 | + | |
| 703 | +// $_wp_plugin_file = $plugin; | |
| 704 | +// include_once $plugin; | |
| 705 | +// $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin. | |
| 706 | + | |
| 707 | +// /** | |
| 708 | +// * Fires once a single activated plugin has loaded. | |
| 709 | +// * | |
| 710 | +// * @since 5.1.0 | |
| 711 | +// * | |
| 712 | +// * @param string $plugin Full path to the plugin's main file. | |
| 713 | +// */ | |
| 714 | +// do_action( 'plugin_loaded', $plugin ); | |
| 715 | +// } | |
| 716 | +// unset( $plugin, $_wp_plugin_file, $plugin_data, $textdomain ); | |
| 717 | + | |
| 420 | 718 | // Load pluggable functions. |
| 421 | 719 | pd_maybe_require( ABSPATH . WPINC . '/pluggable.php' ); |
| 422 | 720 | pd_maybe_require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); |
| 423 | 721 | |
| @@ -424,11 +722,11 @@ | ||
| 424 | 722 | // Set internal encoding. |
| 425 | 723 | wp_set_internal_encoding(); |
| 426 | 724 | |
| 427 | 725 | // Run wp_cache_postload() if object cache is enabled and the function exists. |
| 428 | -if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) | |
| 726 | +if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { | |
| 429 | 727 | wp_cache_postload(); |
| 430 | - | |
| 728 | +} | |
| 431 | 729 | /** |
| 432 | 730 | * Fires once activated plugins have loaded. |
| 433 | 731 | * |
| 434 | 732 | * Pluggable functions are also available at this point in the loading order. |
| @@ -500,9 +798,13 @@ | ||
| 500 | 798 | */ |
| 501 | 799 | do_action( 'setup_theme' ); |
| 502 | 800 | |
| 503 | 801 | // Define the template related constants. |
| 504 | -wp_templating_constants( ); | |
| 802 | +wp_templating_constants(); | |
| 803 | +if( function_exists( 'wp_set_template_globals' ) ) { | |
| 804 | + // introduced in WP6.5 | |
| 805 | + wp_set_template_globals(); | |
| 806 | +} | |
| 505 | 807 | |
| 506 | 808 | // Load the default text localization domain. |
| 507 | 809 | load_default_textdomain(); |
| 508 | 810 | |
| @@ -530,13 +832,19 @@ | ||
| 530 | 832 | $GLOBALS['wp_locale_switcher']->init(); |
| 531 | 833 | |
| 532 | 834 | // Load the functions for the active theme, for both parent and child theme if applicable. |
| 533 | 835 | if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) { |
| 534 | - if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) | |
| 535 | - include( STYLESHEETPATH . '/functions.php' ); | |
| 536 | - if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) | |
| 537 | - include( TEMPLATEPATH . '/functions.php' ); | |
| 836 | + foreach ( wp_get_active_and_valid_themes() as $theme ) { | |
| 837 | + $wp_theme = wp_get_theme( basename( $theme ) ); | |
| 838 | + | |
| 839 | + $wp_theme->load_textdomain(); | |
| 840 | + | |
| 841 | + if ( file_exists( $theme . '/functions.php' ) ) { | |
| 842 | + include $theme . '/functions.php'; | |
| 843 | + } | |
| 844 | + } | |
| 538 | 845 | } |
| 846 | +unset( $theme, $wp_theme ); | |
| 539 | 847 | |
| 540 | 848 | /** |
| 541 | 849 | * Fires after the theme is loaded. |
| 542 | 850 | * |
| @@ -580,9 +888,9 @@ | ||
| 580 | 888 | * |
| 581 | 889 | * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for |
| 582 | 890 | * users not logged in. |
| 583 | 891 | * |
| 584 | - * @link https://codex.wordpress.org/AJAX_in_Plugins | |
| 892 | + * @link https://developer.wordpress.org/plugins/javascript/ajax | |
| 585 | 893 | * |
| 586 | 894 | * @since 3.0.0 |
| 587 | 895 | */ |
| 588 | 896 | do_action( 'wp_loaded' ); |