| @@ -1,16 +1,23 @@ | ||
| 1 | 1 | <?php |
| 2 | -// use when needed to compare wp version for compatibility | |
| 3 | -global $global_wp_version; | |
| 4 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit; | |
| 5 | +} | |
| 6 | + | |
| 5 | 7 | function pd_maybe_require( $path ) { |
| 6 | 8 | if ( file_exists( $path ) ) { |
| 7 | 9 | require_once $path; |
| 8 | 10 | } |
| 9 | - | |
| 10 | - if( !empty( $wp_version ) ){ | |
| 11 | - global $global_wp_version; | |
| 12 | - $global_wp_version = $wp_version; | |
| 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 | + } | |
| 13 | 20 | } |
| 14 | 21 | } |
| 15 | 22 | /** |
| 16 | 23 | * Troubleshoot Settings. |
| @@ -71,18 +78,32 @@ | ||
| 71 | 78 | * @since 1.0.0 |
| 72 | 79 | */ |
| 73 | 80 | define( 'WPINC', 'wp-includes' ); |
| 74 | 81 | |
| 75 | -/* | |
| 82 | +/** | |
| 83 | + * Version information for the current WordPress release. | |
| 84 | + * | |
| 76 | 85 | * These can't be directly globalized in version.php. When updating, |
| 77 | - * we're including version.php from another installation and don't want | |
| 78 | - * these values to be overridden if already set. | |
| 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. | |
| 79 | 96 | */ |
| 80 | -global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package; | |
| 97 | +global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wp_local_package; | |
| 81 | 98 | pd_maybe_require( ABSPATH . WPINC . '/version.php' ); |
| 99 | +pd_maybe_require( ABSPATH . WPINC . '/compat-utf8.php' ); | |
| 82 | 100 | pd_maybe_require( ABSPATH . WPINC . '/compat.php' ); |
| 83 | 101 | pd_maybe_require( ABSPATH . WPINC . '/load.php' ); |
| 84 | 102 | |
| 103 | +// Check the server requirements. | |
| 104 | +// wp_check_php_mysql_versions(); | |
| 105 | + | |
| 85 | 106 | // Include files required for initialization. |
| 86 | 107 | @include( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' ); |
| 87 | 108 | @include( ABSPATH . WPINC . '/class-wp-exception.php' ); |
| 88 | 109 | @include( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' ); |
| @@ -116,12 +137,13 @@ | ||
| 116 | 137 | // Check for the required PHP version and for the MySQL extension or a database drop-in. |
| 117 | 138 | wp_check_php_mysql_versions(); |
| 118 | 139 | |
| 119 | 140 | // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. |
| 120 | -@ini_set( 'magic_quotes_runtime', 0 ); | |
| 121 | -@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). | |
| 122 | 143 | |
| 123 | 144 | // WordPress calculates offsets from UTC. |
| 145 | +// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set | |
| 124 | 146 | date_default_timezone_set( 'UTC' ); |
| 125 | 147 | |
| 126 | 148 | // Standardize $_SERVER variables across setups. |
| 127 | 149 | wp_fix_server_vars(); |
| @@ -167,10 +189,13 @@ | ||
| 167 | 189 | |
| 168 | 190 | // Load early WordPress files. |
| 169 | 191 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-list-util.php' ); |
| 170 | 192 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-token-map.php' ); |
| 193 | +pd_maybe_require( ABSPATH . WPINC . '/utf8.php' ); | |
| 171 | 194 | pd_maybe_require( ABSPATH . WPINC . '/formatting.php' ); |
| 195 | +pd_maybe_require( ABSPATH . WPINC . '/meta.php' ); | |
| 172 | 196 | pd_maybe_require( ABSPATH . WPINC . '/functions.php' ); |
| 197 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-meta-query.php' ); | |
| 173 | 198 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-matchesmapregex.php' ); |
| 174 | 199 | pd_maybe_require( ABSPATH . WPINC . '/class-wp.php' ); |
| 175 | 200 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-error.php' ); |
| 176 | 201 | pd_maybe_require( ABSPATH . WPINC . '/pomo/mo.php' ); |
| @@ -179,13 +204,27 @@ | ||
| 179 | 204 | pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file.php' ); |
| 180 | 205 | pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file-mo.php' ); |
| 181 | 206 | pd_maybe_require( ABSPATH . WPINC . '/l10n/class-wp-translation-file-php.php' ); |
| 182 | 207 | |
| 208 | +/** | |
| 209 | + * @since 0.71 | |
| 210 | + * | |
| 211 | + * @global wpdb $wpdb WordPress database abstraction object. | |
| 212 | + */ | |
| 213 | +global $wpdb; | |
| 183 | 214 | // Include the wpdb class and, if present, a db.php database drop-in. |
| 184 | -global $wpdb; | |
| 185 | 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 | + | |
| 186 | 226 | // Set the database table prefix and the format specifiers for database table columns. |
| 187 | -$GLOBALS['table_prefix'] = $table_prefix; | |
| 188 | 227 | wp_set_wpdb_vars(); |
| 189 | 228 | |
| 190 | 229 | // Start the WordPress object cache, or an external object cache if the drop-in is present. |
| 191 | 230 | wp_start_object_cache(); |
| @@ -232,8 +271,9 @@ | ||
| 232 | 271 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user.php' ); |
| 233 | 272 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-query.php' ); |
| 234 | 273 | pd_maybe_require( ABSPATH . WPINC . '/query.php' ); |
| 235 | 274 | pd_maybe_require( ABSPATH . WPINC . '/date.php' ); |
| 275 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-date-query.php' ); | |
| 236 | 276 | pd_maybe_require( ABSPATH . WPINC . '/theme.php' ); |
| 237 | 277 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme.php' ); |
| 238 | 278 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json-schema.php' ); |
| 239 | 279 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-theme-json-data.php' ); |
| @@ -247,8 +287,10 @@ | ||
| 247 | 287 | pd_maybe_require( ABSPATH . WPINC . '/block-template.php' ); |
| 248 | 288 | pd_maybe_require( ABSPATH . WPINC . '/theme-templates.php' ); |
| 249 | 289 | pd_maybe_require( ABSPATH . WPINC . '/theme-previews.php' ); |
| 250 | 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' ); | |
| 251 | 293 | pd_maybe_require( ABSPATH . WPINC . '/https-detection.php' ); |
| 252 | 294 | pd_maybe_require( ABSPATH . WPINC . '/https-migration.php' ); |
| 253 | 295 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-user-request.php' ); |
| 254 | 296 | pd_maybe_require( ABSPATH . WPINC . '/user.php' ); |
| @@ -290,8 +332,10 @@ | ||
| 290 | 332 | pd_maybe_require( ABSPATH . WPINC . '/kses.php' ); |
| 291 | 333 | pd_maybe_require( ABSPATH . WPINC . '/cron.php' ); |
| 292 | 334 | pd_maybe_require( ABSPATH . WPINC . '/deprecated.php' ); |
| 293 | 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' ); | |
| 294 | 338 | pd_maybe_require( ABSPATH . WPINC . '/taxonomy.php' ); |
| 295 | 339 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-taxonomy.php' ); |
| 296 | 340 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-term.php' ); |
| 297 | 341 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-term-query.php' ); |
| @@ -301,8 +345,9 @@ | ||
| 301 | 345 | pd_maybe_require( ABSPATH . WPINC . '/shortcodes.php' ); |
| 302 | 346 | pd_maybe_require( ABSPATH . WPINC . '/embed.php' ); |
| 303 | 347 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-embed.php' ); |
| 304 | 348 | pd_maybe_require( ABSPATH . WPINC . '/class-oembed.php' ); |
| 349 | +pd_maybe_require( ABSPATH . WPINC . '/class-wp-oembed.php' ); | |
| 305 | 350 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); |
| 306 | 351 | pd_maybe_require( ABSPATH . WPINC . '/media.php' ); |
| 307 | 352 | pd_maybe_require( ABSPATH . WPINC . '/http.php' ); |
| 308 | 353 | pd_maybe_require( ABSPATH . WPINC . '/class-http.php' ); |
| @@ -319,8 +364,12 @@ | ||
| 319 | 364 | pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-token.php' ); |
| 320 | 365 | pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-stack-event.php' ); |
| 321 | 366 | pd_maybe_require( ABSPATH . WPINC . '/html-api/class-wp-html-processor-state.php' ); |
| 322 | 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 | +} | |
| 323 | 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 |
| 324 | 373 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); |
| 325 | 374 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); |
| 326 | 375 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); |
| @@ -328,8 +377,21 @@ | ||
| 328 | 377 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); |
| 329 | 378 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-response.php' ); |
| 330 | 379 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); |
| 331 | 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' ); | |
| 332 | 394 | pd_maybe_require( ABSPATH . WPINC . '/widgets.php' ); |
| 333 | 395 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-widget.php' ); |
| 334 | 396 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); |
| 335 | 397 | pd_maybe_require( ABSPATH . WPINC . '/nav-menu-template.php' ); |
| @@ -334,9 +396,21 @@ | ||
| 334 | 396 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); |
| 335 | 397 | pd_maybe_require( ABSPATH . WPINC . '/nav-menu-template.php' ); |
| 336 | 398 | pd_maybe_require( ABSPATH . WPINC . '/nav-menu.php' ); |
| 337 | 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' ); | |
| 338 | 411 | pd_maybe_require( ABSPATH . WPINC . '/rest-api.php' ); |
| 412 | +pd_maybe_require( ABSPATH . WPINC . '/json-schema.php' ); | |
| 339 | 413 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); |
| 340 | 414 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); |
| 341 | 415 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); |
| 342 | 416 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' ); |
| @@ -346,9 +420,11 @@ | ||
| 346 | 420 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php' ); |
| 347 | 421 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php' ); |
| 348 | 422 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php' ); |
| 349 | 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' ); | |
| 350 | 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' ); | |
| 351 | 427 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php' ); |
| 352 | 428 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php' ); |
| 353 | 429 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-items-controller.php' ); |
| 354 | 430 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menus-controller.php' ); |
| @@ -364,8 +440,10 @@ | ||
| 364 | 440 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php' ); |
| 365 | 441 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php' ); |
| 366 | 442 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php' ); |
| 367 | 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' ); | |
| 368 | 446 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php' ); |
| 369 | 447 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-site-health-controller.php' ); |
| 370 | 448 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-sidebars-controller.php' ); |
| 371 | 449 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widget-types-controller.php' ); |
| @@ -375,8 +453,14 @@ | ||
| 375 | 453 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php' ); |
| 376 | 454 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-families-controller.php' ); |
| 377 | 455 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-faces-controller.php' ); |
| 378 | 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' ); | |
| 379 | 463 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' ); |
| 380 | 464 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' ); |
| 381 | 465 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' ); |
| 382 | 466 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' ); |
| @@ -383,8 +467,10 @@ | ||
| 383 | 467 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' ); |
| 384 | 468 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' ); |
| 385 | 469 | pd_maybe_require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' ); |
| 386 | 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' ); | |
| 387 | 473 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps.php' ); |
| 388 | 474 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps.php' ); |
| 389 | 475 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-index.php' ); |
| 390 | 476 | pd_maybe_require( ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php' ); |
| @@ -406,14 +492,18 @@ | ||
| 406 | 492 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); |
| 407 | 493 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block.php' ); |
| 408 | 494 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-list.php' ); |
| 409 | 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' ); | |
| 410 | 498 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); |
| 411 | 499 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-classic-to-block-menu-converter.php' ); |
| 412 | 500 | pd_maybe_require( ABSPATH . WPINC . '/class-wp-navigation-fallback.php' ); |
| 413 | 501 | pd_maybe_require( ABSPATH . WPINC . '/block-bindings.php' ); |
| 414 | 502 | pd_maybe_require( ABSPATH . WPINC . '/block-bindings/pattern-overrides.php' ); |
| 503 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/post-data.php' ); | |
| 415 | 504 | pd_maybe_require( ABSPATH . WPINC . '/block-bindings/post-meta.php' ); |
| 505 | +pd_maybe_require( ABSPATH . WPINC . '/block-bindings/term-data.php' ); | |
| 416 | 506 | pd_maybe_require( ABSPATH . WPINC . '/blocks.php' ); |
| 417 | 507 | pd_maybe_require( ABSPATH . WPINC . '/blocks/index.php' ); |
| 418 | 508 | pd_maybe_require( ABSPATH . WPINC . '/block-editor.php' ); |
| 419 | 509 | pd_maybe_require( ABSPATH . WPINC . '/block-patterns.php' ); |
| @@ -434,10 +524,14 @@ | ||
| 434 | 524 | pd_maybe_require( ABSPATH . WPINC . '/block-supports/duotone.php' ); |
| 435 | 525 | pd_maybe_require( ABSPATH . WPINC . '/block-supports/shadow.php' ); |
| 436 | 526 | pd_maybe_require( ABSPATH . WPINC . '/block-supports/background.php' ); |
| 437 | 527 | pd_maybe_require( ABSPATH . WPINC . '/block-supports/block-style-variations.php' ); |
| 438 | - | |
| 439 | -pd_maybe_require( ABSPATH . WPINC . '/navigation-fallback.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' ); | |
| 440 | 534 | pd_maybe_require( ABSPATH . WPINC . '/style-engine.php' ); |
| 441 | 535 | pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine.php' ); |
| 442 | 536 | pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-declarations.php' ); |
| 443 | 537 | pd_maybe_require( ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-rule.php' ); |
| @@ -454,8 +548,12 @@ | ||
| 454 | 548 | pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api.php' ); |
| 455 | 549 | pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api-directives-processor.php' ); |
| 456 | 550 | pd_maybe_require( ABSPATH . WPINC . '/interactivity-api/interactivity-api.php' ); |
| 457 | 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' ); | |
| 458 | 556 | |
| 459 | 557 | if ( function_exists( 'wp_script_modules' ) ) { |
| 460 | 558 | add_action( 'after_setup_theme', array( wp_script_modules(), 'add_hooks' ) ); |
| 461 | 559 | } |
| @@ -518,11 +616,23 @@ | ||
| 518 | 616 | // Load network activated plugins. |
| 519 | 617 | if ( is_multisite() ) { |
| 520 | 618 | foreach ( wp_get_active_network_plugins() as $network_plugin ) { |
| 521 | 619 | wp_register_plugin_realpath( $network_plugin ); |
| 522 | - 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 ); | |
| 523 | 633 | } |
| 524 | - unset( $network_plugin ); | |
| 634 | + unset( $network_plugin, $_wp_plugin_file ); | |
| 525 | 635 | } |
| 526 | 636 | |
| 527 | 637 | /** |
| 528 | 638 | * Fires once all must-use and network-activated plugins have loaded. |
| @@ -566,8 +676,46 @@ | ||
| 566 | 676 | // unset( $plugin ); |
| 567 | 677 | |
| 568 | 678 | /* PD: End cache disable */ |
| 569 | 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 | + | |
| 570 | 718 | // Load pluggable functions. |
| 571 | 719 | pd_maybe_require( ABSPATH . WPINC . '/pluggable.php' ); |
| 572 | 720 | pd_maybe_require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); |
| 573 | 721 | |
| @@ -684,14 +832,19 @@ | ||
| 684 | 832 | $GLOBALS['wp_locale_switcher']->init(); |
| 685 | 833 | |
| 686 | 834 | // Load the functions for the active theme, for both parent and child theme if applicable. |
| 687 | 835 | if ( ! wp_installing() || 'wp-activate.php' === $pagenow ) { |
| 688 | - if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) | |
| 689 | - include( STYLESHEETPATH . '/functions.php' ); | |
| 690 | - if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) | |
| 691 | - 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 | + } | |
| 692 | 845 | } |
| 693 | -unset( $theme ); | |
| 846 | +unset( $theme, $wp_theme ); | |
| 694 | 847 | |
| 695 | 848 | /** |
| 696 | 849 | * Fires after the theme is loaded. |
| 697 | 850 | * |