[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/ -> wp-settings.php (source)

   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  /**
  19   * Version information for the current WordPress release.
  20   *
  21   * These can't be directly globalized in version.php. When updating,
  22   * include version.php from another installation and don't override
  23   * these values if already set.
  24   *
  25   * @global string   $wp_version              The WordPress version string.
  26   * @global int      $wp_db_version           WordPress database version.
  27   * @global string   $tinymce_version         TinyMCE version.
  28   * @global string   $required_php_version    The minimum required PHP version string.
  29   * @global string[] $required_php_extensions The names of required PHP extensions.
  30   * @global string   $required_mysql_version  The minimum required MySQL version string.
  31   * @global string   $wp_local_package        Locale code of the package.
  32   */
  33  global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wp_local_package;
  34  require  ABSPATH . WPINC . '/version.php';
  35  require ABSPATH . WPINC . '/compat-utf8.php';
  36  require ABSPATH . WPINC . '/compat.php';
  37  require ABSPATH . WPINC . '/load.php';
  38  
  39  // Check the server requirements.
  40  wp_check_php_mysql_versions();
  41  
  42  // Include files required for initialization.
  43  require ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php';
  44  require ABSPATH . WPINC . '/class-wp-exception.php';
  45  require ABSPATH . WPINC . '/class-wp-fatal-error-handler.php';
  46  require ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php';
  47  require ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php';
  48  require ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php';
  49  require ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php';
  50  require ABSPATH . WPINC . '/class-wp-recovery-mode.php';
  51  require ABSPATH . WPINC . '/error-protection.php';
  52  require ABSPATH . WPINC . '/default-constants.php';
  53  require_once  ABSPATH . WPINC . '/plugin.php';
  54  
  55  /**
  56   * If not already configured, `$blog_id` will default to 1 in a single site
  57   * configuration. In multisite, it will be overridden by default in ms-settings.php.
  58   *
  59   * @since 2.0.0
  60   *
  61   * @global int $blog_id
  62   */
  63  global $blog_id;
  64  
  65  // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE.
  66  wp_initial_constants();
  67  
  68  // Register the shutdown handler for fatal errors as soon as possible.
  69  wp_register_fatal_error_handler();
  70  
  71  // WordPress calculates offsets from UTC.
  72  // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
  73  date_default_timezone_set( 'UTC' );
  74  
  75  // Standardize $_SERVER variables across setups.
  76  wp_fix_server_vars();
  77  
  78  // Check if the site is in maintenance mode.
  79  wp_maintenance();
  80  
  81  // Start loading timer.
  82  timer_start();
  83  
  84  // Check if WP_DEBUG mode is enabled.
  85  wp_debug_mode();
  86  
  87  /**
  88   * Filters whether to enable loading of the advanced-cache.php drop-in.
  89   *
  90   * This filter runs before it can be used by plugins. It is designed for non-web
  91   * run-times. If false is returned, advanced-cache.php will never be loaded.
  92   *
  93   * @since 4.6.0
  94   *
  95   * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).
  96   *                                    Default true.
  97   */
  98  if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
  99      // For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
 100      include WP_CONTENT_DIR . '/advanced-cache.php';
 101  
 102      // Re-initialize any hooks added manually by advanced-cache.php.
 103      if ( $wp_filter ) {
 104          $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );
 105      }
 106  }
 107  
 108  // Define WP_LANG_DIR if not set.
 109  wp_set_lang_dir();
 110  
 111  // Load early WordPress files.
 112  require ABSPATH . WPINC . '/class-wp-list-util.php';
 113  require ABSPATH . WPINC . '/class-wp-token-map.php';
 114  require ABSPATH . WPINC . '/utf8.php';
 115  require ABSPATH . WPINC . '/class-wp-email-address.php';
 116  require ABSPATH . WPINC . '/formatting.php';
 117  require ABSPATH . WPINC . '/meta.php';
 118  require  ABSPATH . WPINC . '/functions.php';
 119  require ABSPATH . WPINC . '/class-wp-meta-query.php';
 120  require ABSPATH . WPINC . '/class-wp-matchesmapregex.php';
 121  require ABSPATH . WPINC . '/class-wp.php';
 122  require  ABSPATH . WPINC . '/class-wp-error.php';
 123  require  ABSPATH . WPINC . '/pomo/mo.php';
 124  require  ABSPATH . WPINC . '/l10n/class-wp-translation-controller.php';
 125  require  ABSPATH . WPINC . '/l10n/class-wp-translations.php';
 126  require  ABSPATH . WPINC . '/l10n/class-wp-translation-file.php';
 127  require  ABSPATH . WPINC . '/l10n/class-wp-translation-file-mo.php';
 128  require  ABSPATH . WPINC . '/l10n/class-wp-translation-file-php.php';
 129  
 130  /**
 131   * @since 0.71
 132   *
 133   * @global wpdb $wpdb WordPress database abstraction object.
 134   */
 135  global $wpdb;
 136  // Include the wpdb class and, if present, a db.php database drop-in.
 137  require_wp_db();
 138  
 139  /**
 140   * @since 3.3.0
 141   *
 142   * @global string $table_prefix The database table prefix.
 143   */
 144  if ( ! isset( $GLOBALS['table_prefix'] ) ) {
 145      $GLOBALS['table_prefix'] = $table_prefix;
 146  }
 147  
 148  // Set the database table prefix and the format specifiers for database table columns.
 149  wp_set_wpdb_vars();
 150  
 151  // Start the WordPress object cache, or an external object cache if the drop-in is present.
 152  wp_start_object_cache();
 153  
 154  // Attach the default filters.
 155  require ABSPATH . WPINC . '/default-filters.php';
 156  
 157  // Initialize multisite if enabled.
 158  if ( is_multisite() ) {
 159      require ABSPATH . WPINC . '/class-wp-site-query.php';
 160      require ABSPATH . WPINC . '/class-wp-network-query.php';
 161      require ABSPATH . WPINC . '/ms-blogs.php';
 162      require ABSPATH . WPINC . '/ms-settings.php';
 163  } elseif ( ! defined( 'MULTISITE' ) ) {
 164      define( 'MULTISITE', false );
 165  }
 166  
 167  register_shutdown_function( 'shutdown_action_hook' );
 168  
 169  // Stop most of WordPress from being loaded if SHORTINIT is enabled.
 170  if ( SHORTINIT ) {
 171      return false;
 172  }
 173  
 174  // Load the L10n library.
 175  require_once  ABSPATH . WPINC . '/l10n.php';
 176  require_once  ABSPATH . WPINC . '/class-wp-textdomain-registry.php';
 177  require_once  ABSPATH . WPINC . '/class-wp-locale.php';
 178  require_once  ABSPATH . WPINC . '/class-wp-locale-switcher.php';
 179  
 180  // Run the installer if WordPress is not installed.
 181  wp_not_installed();
 182  
 183  // Load most of WordPress.
 184  require ABSPATH . WPINC . '/class-wp-walker.php';
 185  require ABSPATH . WPINC . '/class-wp-ajax-response.php';
 186  require ABSPATH . WPINC . '/capabilities.php';
 187  require ABSPATH . WPINC . '/class-wp-roles.php';
 188  require ABSPATH . WPINC . '/class-wp-role.php';
 189  require ABSPATH . WPINC . '/class-wp-user.php';
 190  require ABSPATH . WPINC . '/class-wp-query.php';
 191  require ABSPATH . WPINC . '/query.php';
 192  require  ABSPATH . WPINC . '/class-wp-date-query.php';
 193  require ABSPATH . WPINC . '/theme.php';
 194  require ABSPATH . WPINC . '/class-wp-theme.php';
 195  require ABSPATH . WPINC . '/class-wp-theme-json-schema.php';
 196  require ABSPATH . WPINC . '/class-wp-theme-json-data.php';
 197  require ABSPATH . WPINC . '/class-wp-theme-json.php';
 198  require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
 199  require ABSPATH . WPINC . '/class-wp-duotone.php';
 200  require ABSPATH . WPINC . '/global-styles-and-settings.php';
 201  require ABSPATH . WPINC . '/class-wp-block-template.php';
 202  require ABSPATH . WPINC . '/class-wp-block-templates-registry.php';
 203  require ABSPATH . WPINC . '/block-template-utils.php';
 204  require ABSPATH . WPINC . '/block-template.php';
 205  require ABSPATH . WPINC . '/theme-templates.php';
 206  require ABSPATH . WPINC . '/theme-previews.php';
 207  require ABSPATH . WPINC . '/template.php';
 208  require ABSPATH . WPINC . '/https-detection.php';
 209  require ABSPATH . WPINC . '/https-migration.php';
 210  require ABSPATH . WPINC . '/class-wp-user-request.php';
 211  require ABSPATH . WPINC . '/user.php';
 212  require ABSPATH . WPINC . '/class-wp-user-query.php';
 213  require  ABSPATH . WPINC . '/class-wp-session-tokens.php';
 214  require  ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php';
 215  require ABSPATH . WPINC . '/general-template.php';
 216  require ABSPATH . WPINC . '/link-template.php';
 217  require ABSPATH . WPINC . '/author-template.php';
 218  require ABSPATH . WPINC . '/robots-template.php';
 219  require ABSPATH . WPINC . '/post.php';
 220  require ABSPATH . WPINC . '/class-walker-page.php';
 221  require ABSPATH . WPINC . '/class-walker-page-dropdown.php';
 222  require ABSPATH . WPINC . '/class-wp-post-type.php';
 223  require ABSPATH . WPINC . '/class-wp-post.php';
 224  require ABSPATH . WPINC . '/post-template.php';
 225  require ABSPATH . WPINC . '/revision.php';
 226  require ABSPATH . WPINC . '/post-formats.php';
 227  require ABSPATH . WPINC . '/post-thumbnail-template.php';
 228  require ABSPATH . WPINC . '/category.php';
 229  require ABSPATH . WPINC . '/class-walker-category.php';
 230  require ABSPATH . WPINC . '/class-walker-category-dropdown.php';
 231  require ABSPATH . WPINC . '/category-template.php';
 232  require ABSPATH . WPINC . '/comment.php';
 233  require ABSPATH . WPINC . '/class-wp-comment.php';
 234  require ABSPATH . WPINC . '/class-wp-comment-query.php';
 235  require ABSPATH . WPINC . '/class-walker-comment.php';
 236  require ABSPATH . WPINC . '/comment-template.php';
 237  require ABSPATH . WPINC . '/rewrite.php';
 238  require ABSPATH . WPINC . '/class-wp-rewrite.php';
 239  require ABSPATH . WPINC . '/feed.php';
 240  require ABSPATH . WPINC . '/bookmark.php';
 241  require ABSPATH . WPINC . '/bookmark-template.php';
 242  require  ABSPATH . WPINC . '/kses.php';
 243  require ABSPATH . WPINC . '/cron.php';
 244  require ABSPATH . WPINC . '/deprecated.php';
 245  require ABSPATH . WPINC . '/script-loader.php';
 246  if ( file_exists( ABSPATH . WPINC . '/build/routes.php' ) ) {
 247      require ABSPATH . WPINC . '/build/routes.php';
 248  }
 249  if ( file_exists( ABSPATH . WPINC . '/build/pages.php' ) ) {
 250      require ABSPATH . WPINC . '/build/pages.php';
 251  }
 252  require ABSPATH . WPINC . '/taxonomy.php';
 253  require ABSPATH . WPINC . '/class-wp-taxonomy.php';
 254  require ABSPATH . WPINC . '/class-wp-term.php';
 255  require ABSPATH . WPINC . '/class-wp-term-query.php';
 256  require ABSPATH . WPINC . '/class-wp-tax-query.php';
 257  require ABSPATH . WPINC . '/update.php';
 258  require ABSPATH . WPINC . '/canonical.php';
 259  require ABSPATH . WPINC . '/shortcodes.php';
 260  require ABSPATH . WPINC . '/embed.php';
 261  require ABSPATH . WPINC . '/class-wp-embed.php';
 262  require  ABSPATH . WPINC . '/class-wp-oembed.php';
 263  require ABSPATH . WPINC . '/class-wp-oembed-controller.php';
 264  require ABSPATH . WPINC . '/media.php';
 265  require ABSPATH . WPINC . '/http.php';
 266  require ABSPATH . WPINC . '/html-api/html5-named-character-references.php';
 267  require ABSPATH . WPINC . '/html-api/class-wp-html-attribute-token.php';
 268  require ABSPATH . WPINC . '/html-api/class-wp-html-span.php';
 269  require ABSPATH . WPINC . '/html-api/class-wp-html-doctype-info.php';
 270  require ABSPATH . WPINC . '/html-api/class-wp-html-text-replacement.php';
 271  require ABSPATH . WPINC . '/html-api/class-wp-html-decoder.php';
 272  require ABSPATH . WPINC . '/html-api/class-wp-html-tag-processor.php';
 273  require ABSPATH . WPINC . '/html-api/class-wp-html-unsupported-exception.php';
 274  require ABSPATH . WPINC . '/html-api/class-wp-html-active-formatting-elements.php';
 275  require ABSPATH . WPINC . '/html-api/class-wp-html-open-elements.php';
 276  require ABSPATH . WPINC . '/html-api/class-wp-html-token.php';
 277  require ABSPATH . WPINC . '/html-api/class-wp-html-stack-event.php';
 278  require ABSPATH . WPINC . '/html-api/class-wp-html-processor-state.php';
 279  require ABSPATH . WPINC . '/html-api/class-wp-html-processor.php';
 280  require ABSPATH . WPINC . '/class-wp-block-processor.php';
 281  require  ABSPATH . WPINC . '/class-wp-http.php';
 282  require ABSPATH . WPINC . '/class-wp-http-streams.php';
 283  require ABSPATH . WPINC . '/class-wp-http-curl.php';
 284  require ABSPATH . WPINC . '/class-wp-http-proxy.php';
 285  require ABSPATH . WPINC . '/class-wp-http-cookie.php';
 286  require ABSPATH . WPINC . '/class-wp-http-encoding.php';
 287  require ABSPATH . WPINC . '/class-wp-http-response.php';
 288  require ABSPATH . WPINC . '/class-wp-http-requests-response.php';
 289  require ABSPATH . WPINC . '/class-wp-http-requests-hooks.php';
 290  require ABSPATH . WPINC . '/php-ai-client/autoload.php';
 291  require ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-http-client.php';
 292  require ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-cache.php';
 293  require ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-discovery-strategy.php';
 294  require ABSPATH . WPINC . '/ai-client/adapters/class-wp-ai-client-event-dispatcher.php';
 295  require ABSPATH . WPINC . '/ai-client/class-wp-ai-client-ability-function-resolver.php';
 296  require ABSPATH . WPINC . '/ai-client/class-wp-ai-client-prompt-builder.php';
 297  require ABSPATH . WPINC . '/ai-client.php';
 298  require ABSPATH . WPINC . '/class-wp-connector-registry.php';
 299  require ABSPATH . WPINC . '/connectors.php';
 300  require ABSPATH . WPINC . '/class-wp-icons-registry.php';
 301  require ABSPATH . WPINC . '/widgets.php';
 302  require ABSPATH . WPINC . '/class-wp-widget.php';
 303  require ABSPATH . WPINC . '/class-wp-widget-factory.php';
 304  require ABSPATH . WPINC . '/nav-menu-template.php';
 305  require ABSPATH . WPINC . '/nav-menu.php';
 306  require ABSPATH . WPINC . '/admin-bar.php';
 307  require ABSPATH . WPINC . '/class-wp-application-passwords.php';
 308  require ABSPATH . WPINC . '/abilities-api/class-wp-ability-category.php';
 309  require ABSPATH . WPINC . '/abilities-api/class-wp-ability-categories-registry.php';
 310  require ABSPATH . WPINC . '/abilities-api/class-wp-ability.php';
 311  require ABSPATH . WPINC . '/abilities-api/class-wp-abilities-registry.php';
 312  require ABSPATH . WPINC . '/abilities-api.php';
 313  require ABSPATH . WPINC . '/abilities.php';
 314  require ABSPATH . WPINC . '/rest-api.php';
 315  require ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php';
 316  require ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php';
 317  require ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php';
 318  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php';
 319  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php';
 320  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php';
 321  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-controller.php';
 322  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php';
 323  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php';
 324  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php';
 325  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php';
 326  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-template-revisions-controller.php';
 327  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php';
 328  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php';
 329  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php';
 330  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php';
 331  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-items-controller.php';
 332  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menus-controller.php';
 333  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-menu-locations-controller.php';
 334  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php';
 335  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php';
 336  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php';
 337  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php';
 338  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-types-controller.php';
 339  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php';
 340  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php';
 341  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php';
 342  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php';
 343  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php';
 344  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php';
 345  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php';
 346  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-patterns-controller.php';
 347  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php';
 348  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php';
 349  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-site-health-controller.php';
 350  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-sidebars-controller.php';
 351  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widget-types-controller.php';
 352  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-widgets-controller.php';
 353  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-templates-controller.php';
 354  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-url-details-controller.php';
 355  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php';
 356  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-families-controller.php';
 357  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-faces-controller.php';
 358  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-font-collections-controller.php';
 359  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-icons-controller.php';
 360  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-categories-controller.php';
 361  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php';
 362  require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php';
 363  require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php';
 364  require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php';
 365  require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php';
 366  require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php';
 367  require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php';
 368  require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php';
 369  require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php';
 370  require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-term-search-handler.php';
 371  require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-format-search-handler.php';
 372  require ABSPATH . WPINC . '/sitemaps.php';
 373  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps.php';
 374  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-index.php';
 375  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php';
 376  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-registry.php';
 377  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-renderer.php';
 378  require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-stylesheet.php';
 379  require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-posts.php';
 380  require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-taxonomies.php';
 381  require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-users.php';
 382  require ABSPATH . WPINC . '/class-wp-block-bindings-source.php';
 383  require ABSPATH . WPINC . '/class-wp-block-bindings-registry.php';
 384  require ABSPATH . WPINC . '/class-wp-block-editor-context.php';
 385  require ABSPATH . WPINC . '/class-wp-block-type.php';
 386  require ABSPATH . WPINC . '/class-wp-block-pattern-categories-registry.php';
 387  require ABSPATH . WPINC . '/class-wp-block-patterns-registry.php';
 388  require ABSPATH . WPINC . '/class-wp-block-styles-registry.php';
 389  require ABSPATH . WPINC . '/class-wp-block-type-registry.php';
 390  require ABSPATH . WPINC . '/class-wp-block.php';
 391  require ABSPATH . WPINC . '/class-wp-block-list.php';
 392  require ABSPATH . WPINC . '/class-wp-block-metadata-registry.php';
 393  require ABSPATH . WPINC . '/class-wp-block-parser-block.php';
 394  require ABSPATH . WPINC . '/class-wp-block-parser-frame.php';
 395  require ABSPATH . WPINC . '/class-wp-block-parser.php';
 396  require ABSPATH . WPINC . '/class-wp-classic-to-block-menu-converter.php';
 397  require ABSPATH . WPINC . '/class-wp-navigation-fallback.php';
 398  require ABSPATH . WPINC . '/block-bindings.php';
 399  require ABSPATH . WPINC . '/block-bindings/pattern-overrides.php';
 400  require ABSPATH . WPINC . '/block-bindings/post-data.php';
 401  require ABSPATH . WPINC . '/block-bindings/post-meta.php';
 402  require ABSPATH . WPINC . '/block-bindings/term-data.php';
 403  require ABSPATH . WPINC . '/blocks.php';
 404  require ABSPATH . WPINC . '/blocks/index.php';
 405  require ABSPATH . WPINC . '/block-editor.php';
 406  require ABSPATH . WPINC . '/block-patterns.php';
 407  require ABSPATH . WPINC . '/class-wp-block-supports.php';
 408  require ABSPATH . WPINC . '/block-supports/utils.php';
 409  require ABSPATH . WPINC . '/block-supports/align.php';
 410  require ABSPATH . WPINC . '/block-supports/auto-register.php';
 411  require ABSPATH . WPINC . '/block-supports/custom-classname.php';
 412  require ABSPATH . WPINC . '/block-supports/generated-classname.php';
 413  require ABSPATH . WPINC . '/block-supports/settings.php';
 414  require ABSPATH . WPINC . '/block-supports/elements.php';
 415  require ABSPATH . WPINC . '/block-supports/colors.php';
 416  require ABSPATH . WPINC . '/block-supports/typography.php';
 417  require ABSPATH . WPINC . '/block-supports/border.php';
 418  require ABSPATH . WPINC . '/block-supports/layout.php';
 419  require ABSPATH . WPINC . '/block-supports/position.php';
 420  require ABSPATH . WPINC . '/block-supports/spacing.php';
 421  require ABSPATH . WPINC . '/block-supports/dimensions.php';
 422  require ABSPATH . WPINC . '/block-supports/duotone.php';
 423  require ABSPATH . WPINC . '/block-supports/shadow.php';
 424  require ABSPATH . WPINC . '/block-supports/background.php';
 425  require ABSPATH . WPINC . '/block-supports/block-style-variations.php';
 426  require ABSPATH . WPINC . '/block-supports/aria-label.php';
 427  require ABSPATH . WPINC . '/block-supports/anchor.php';
 428  require ABSPATH . WPINC . '/block-supports/block-visibility.php';
 429  require ABSPATH . WPINC . '/block-supports/custom-css.php';
 430  require ABSPATH . WPINC . '/block-supports/states.php';
 431  require ABSPATH . WPINC . '/style-engine.php';
 432  require ABSPATH . WPINC . '/style-engine/class-wp-style-engine.php';
 433  require ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-declarations.php';
 434  require ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-rule.php';
 435  require ABSPATH . WPINC . '/style-engine/class-wp-style-engine-css-rules-store.php';
 436  require ABSPATH . WPINC . '/style-engine/class-wp-style-engine-processor.php';
 437  require ABSPATH . WPINC . '/fonts/class-wp-font-face-resolver.php';
 438  require ABSPATH . WPINC . '/fonts/class-wp-font-collection.php';
 439  require ABSPATH . WPINC . '/fonts/class-wp-font-face.php';
 440  require ABSPATH . WPINC . '/fonts/class-wp-font-library.php';
 441  require ABSPATH . WPINC . '/fonts/class-wp-font-utils.php';
 442  require ABSPATH . WPINC . '/fonts.php';
 443  require ABSPATH . WPINC . '/class-wp-script-modules.php';
 444  require ABSPATH . WPINC . '/script-modules.php';
 445  require ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api.php';
 446  require ABSPATH . WPINC . '/interactivity-api/class-wp-interactivity-api-directives-processor.php';
 447  require ABSPATH . WPINC . '/interactivity-api/interactivity-api.php';
 448  require ABSPATH . WPINC . '/class-wp-plugin-dependencies.php';
 449  require ABSPATH . WPINC . '/class-wp-url-pattern-prefixer.php';
 450  require ABSPATH . WPINC . '/class-wp-speculation-rules.php';
 451  require ABSPATH . WPINC . '/speculative-loading.php';
 452  require ABSPATH . WPINC . '/view-transitions.php';
 453  
 454  add_action( 'after_setup_theme', array( wp_script_modules(), 'add_hooks' ) );
 455  add_action( 'after_setup_theme', array( wp_interactivity(), 'add_hooks' ) );
 456  
 457  /**
 458   * @since 3.3.0
 459   *
 460   * @global WP_Embed $wp_embed WordPress Embed object.
 461   */
 462  $GLOBALS['wp_embed'] = new WP_Embed();
 463  
 464  /**
 465   * WordPress Textdomain Registry object.
 466   *
 467   * Used to support just-in-time translations for manually loaded text domains.
 468   *
 469   * @since 6.1.0
 470   *
 471   * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
 472   */
 473  $GLOBALS['wp_textdomain_registry'] = new WP_Textdomain_Registry();
 474  $GLOBALS['wp_textdomain_registry']->init();
 475  
 476  // WordPress AI Client initialization.
 477  WP_AI_Client_Discovery_Strategy::init();
 478  WordPress\AiClient\AiClient::setCache( new WP_AI_Client_Cache() );
 479  WordPress\AiClient\AiClient::setEventDispatcher( new WP_AI_Client_Event_Dispatcher() );
 480  
 481  // Load multisite-specific files.
 482  if ( is_multisite() ) {
 483      require ABSPATH . WPINC . '/ms-functions.php';
 484      require ABSPATH . WPINC . '/ms-default-filters.php';
 485      require ABSPATH . WPINC . '/ms-deprecated.php';
 486  }
 487  
 488  // Define constants that rely on the API to obtain the default value.
 489  // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
 490  wp_plugin_directory_constants();
 491  
 492  /**
 493   * @since 3.9.0
 494   *
 495   * @global array $wp_plugin_paths
 496   */
 497  $GLOBALS['wp_plugin_paths'] = array();
 498  
 499  // Load must-use plugins.
 500  foreach ( wp_get_mu_plugins() as $mu_plugin ) {
 501      $_wp_plugin_file = $mu_plugin;
 502      include_once $mu_plugin;
 503      $mu_plugin = $_wp_plugin_file; // Avoid stomping of the $mu_plugin variable in a plugin.
 504  
 505      /**
 506       * Fires once a single must-use plugin has loaded.
 507       *
 508       * @since 5.1.0
 509       *
 510       * @param string $mu_plugin Full path to the plugin's main file.
 511       */
 512      do_action( 'mu_plugin_loaded', $mu_plugin );
 513  }
 514  unset( $mu_plugin, $_wp_plugin_file );
 515  
 516  // Load network activated plugins.
 517  if ( is_multisite() ) {
 518      foreach ( wp_get_active_network_plugins() as $network_plugin ) {
 519          wp_register_plugin_realpath( $network_plugin );
 520  
 521          $_wp_plugin_file = $network_plugin;
 522          include_once $network_plugin;
 523          $network_plugin = $_wp_plugin_file; // Avoid stomping of the $network_plugin variable in a plugin.
 524  
 525          /**
 526           * Fires once a single network-activated plugin has loaded.
 527           *
 528           * @since 5.1.0
 529           *
 530           * @param string $network_plugin Full path to the plugin's main file.
 531           */
 532          do_action( 'network_plugin_loaded', $network_plugin );
 533      }
 534      unset( $network_plugin, $_wp_plugin_file );
 535  }
 536  
 537  /**
 538   * Fires once all must-use and network-activated plugins have loaded.
 539   *
 540   * @since 2.8.0
 541   */
 542  do_action( 'muplugins_loaded' );
 543  
 544  if ( is_multisite() ) {
 545      ms_cookie_constants();
 546  }
 547  
 548  // Define constants after multisite is loaded.
 549  wp_cookie_constants();
 550  
 551  // Define and enforce our SSL constants.
 552  wp_ssl_constants();
 553  
 554  // Create common globals.
 555  require ABSPATH . WPINC . '/vars.php';
 556  
 557  // Make taxonomies and posts available to plugins and themes.
 558  // @plugin authors: warning: these get registered again on the init hook.
 559  create_initial_taxonomies();
 560  create_initial_post_types();
 561  
 562  wp_start_scraping_edited_file_errors();
 563  
 564  // Register the default theme directory root.
 565  register_theme_directory( get_theme_root() );
 566  
 567  if ( ! is_multisite() && wp_is_fatal_error_handler_enabled() ) {
 568      // Handle users requesting a recovery mode link and initiating recovery mode.
 569      wp_recovery_mode()->initialize();
 570  }
 571  
 572  // To make get_plugin_data() available in a way that's compatible with plugins also loading this file, see #62244.
 573  require_once  ABSPATH . 'wp-admin/includes/plugin.php';
 574  
 575  // Load active plugins.
 576  foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
 577      wp_register_plugin_realpath( $plugin );
 578  
 579      $plugin_data = get_plugin_data( $plugin, false, false );
 580  
 581      $textdomain = $plugin_data['TextDomain'];
 582      if ( $textdomain ) {
 583          if ( $plugin_data['DomainPath'] ) {
 584              $GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $plugin ) . $plugin_data['DomainPath'] );
 585          } else {
 586              $GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $plugin ) );
 587          }
 588      }
 589  
 590      $_wp_plugin_file = $plugin;
 591      include_once $plugin;
 592      $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
 593  
 594      /**
 595       * Fires once a single activated plugin has loaded.
 596       *
 597       * @since 5.1.0
 598       *
 599       * @param string $plugin Full path to the plugin's main file.
 600       */
 601      do_action( 'plugin_loaded', $plugin );
 602  }
 603  unset( $plugin, $_wp_plugin_file, $plugin_data, $textdomain );
 604  
 605  // Load pluggable functions.
 606  require  ABSPATH . WPINC . '/pluggable.php';
 607  require ABSPATH . WPINC . '/pluggable-deprecated.php';
 608  
 609  // Set internal encoding.
 610  wp_set_internal_encoding();
 611  
 612  // Run wp_cache_postload() if object cache is enabled and the function exists.
 613  if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) {
 614      wp_cache_postload();
 615  }
 616  
 617  /**
 618   * Fires once activated plugins have loaded.
 619   *
 620   * Pluggable functions are also available at this point in the loading order.
 621   *
 622   * @since 1.5.0
 623   */
 624  do_action( 'plugins_loaded' );
 625  
 626  // Define constants which affect functionality if not already defined.
 627  wp_functionality_constants();
 628  
 629  // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ).
 630  wp_magic_quotes();
 631  
 632  /**
 633   * Fires when comment cookies are sanitized.
 634   *
 635   * @since 2.0.11
 636   */
 637  do_action( 'sanitize_comment_cookies' );
 638  
 639  /**
 640   * WordPress Query object
 641   *
 642   * @since 2.0.0
 643   *
 644   * @global WP_Query $wp_the_query WordPress Query object.
 645   */
 646  $GLOBALS['wp_the_query'] = new WP_Query();
 647  
 648  /**
 649   * Holds the reference to {@see $wp_the_query}.
 650   * Use this global for WordPress queries
 651   *
 652   * @since 1.5.0
 653   *
 654   * @global WP_Query $wp_query WordPress Query object.
 655   */
 656  $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
 657  
 658  /**
 659   * Holds the WordPress Rewrite object for creating pretty URLs
 660   *
 661   * @since 1.5.0
 662   *
 663   * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
 664   */
 665  $GLOBALS['wp_rewrite'] = new WP_Rewrite();
 666  
 667  /**
 668   * WordPress Object
 669   *
 670   * @since 2.0.0
 671   *
 672   * @global WP $wp Current WordPress environment instance.
 673   */
 674  $GLOBALS['wp'] = new WP();
 675  
 676  /**
 677   * WordPress Widget Factory Object
 678   *
 679   * @since 2.8.0
 680   *
 681   * @global WP_Widget_Factory $wp_widget_factory
 682   */
 683  $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
 684  
 685  /**
 686   * WordPress User Roles
 687   *
 688   * @since 2.0.0
 689   *
 690   * @global WP_Roles $wp_roles WordPress role management object.
 691   */
 692  $GLOBALS['wp_roles'] = new WP_Roles();
 693  
 694  /**
 695   * Fires before the theme is loaded.
 696   *
 697   * @since 2.6.0
 698   */
 699  do_action( 'setup_theme' );
 700  
 701  // Define the template related constants and globals.
 702  wp_templating_constants();
 703  wp_set_template_globals();
 704  
 705  // Load the default text localization domain.
 706  load_default_textdomain();
 707  
 708  $locale      = get_locale();
 709  $locale_file = WP_LANG_DIR . "/$locale.php";
 710  if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) {
 711      require $locale_file;
 712  }
 713  unset( $locale_file );
 714  
 715  /**
 716   * WordPress Locale object for loading locale domain date and various strings.
 717   *
 718   * @since 2.1.0
 719   *
 720   * @global WP_Locale $wp_locale WordPress date and time locale object.
 721   */
 722  $GLOBALS['wp_locale'] = new WP_Locale();
 723  
 724  /**
 725   * WordPress Locale Switcher object for switching locales.
 726   *
 727   * @since 4.7.0
 728   *
 729   * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
 730   */
 731  $GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher();
 732  $GLOBALS['wp_locale_switcher']->init();
 733  
 734  // Load the functions for the active theme, for both parent and child theme if applicable.
 735  foreach ( wp_get_active_and_valid_themes() as $theme ) {
 736      $wp_theme = wp_get_theme( basename( $theme ) );
 737  
 738      $wp_theme->load_textdomain();
 739  
 740      if ( file_exists( $theme . '/functions.php' ) ) {
 741          include $theme . '/functions.php';
 742      }
 743  }
 744  unset( $theme, $wp_theme );
 745  
 746  /**
 747   * Fires after the theme is loaded.
 748   *
 749   * @since 3.0.0
 750   */
 751  do_action( 'after_setup_theme' );
 752  
 753  // Create an instance of WP_Site_Health so that Cron events may fire.
 754  if ( ! class_exists( 'WP_Site_Health' ) ) {
 755      require_once  ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
 756  }
 757  WP_Site_Health::get_instance();
 758  
 759  // Set up current user.
 760  $GLOBALS['wp']->init();
 761  
 762  /**
 763   * Fires after WordPress has finished loading but before any headers are sent.
 764   *
 765   * Most of WP is loaded at this stage, and the user is authenticated. WP continues
 766   * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate
 767   * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
 768   *
 769   * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
 770   *
 771   * @since 1.5.0
 772   */
 773  do_action( 'init' );
 774  
 775  // Check site status.
 776  if ( is_multisite() ) {
 777      $file = ms_site_check();
 778      if ( true !== $file ) {
 779          require $file;
 780          die();
 781      }
 782      unset( $file );
 783  }
 784  
 785  /**
 786   * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
 787   *
 788   * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
 789   * users not logged in.
 790   *
 791   * @link https://developer.wordpress.org/plugins/javascript/ajax
 792   *
 793   * @since 3.0.0
 794   */
 795  do_action( 'wp_loaded' );


Generated : Sun Jun 14 08:20:09 2026 Cross-referenced by PHPXref