Make WordPress Core

Changeset 47568


Ignore:
Timestamp:
04/10/2020 03:55:08 AM (5 years ago)
Author:
whyisjake
Message:

Site Health instantiation prevents use of some hooks by plugins.

As the WP_Site_Health class is instantiated prior to plugins being required and the plugins_loaded hook being fired, it prevents plugins from using the following hooks in the functions called by maybe_create_scheduled_event().

Fixes #49824.
Props peterwilsoncc, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r47552 r47568  
    367367}
    368368
    369 // Create an instance of WP_Site_Health so that Cron events may fire.
    370 if ( ! class_exists( 'WP_Site_Health' ) ) {
    371     require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
    372 }
    373 WP_Site_Health::get_instance();
    374 
    375369// Load active plugins.
    376370foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
     
    525519do_action( 'after_setup_theme' );
    526520
     521// Create an instance of WP_Site_Health so that Cron events may fire.
     522if ( ! class_exists( 'WP_Site_Health' ) ) {
     523    require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
     524}
     525WP_Site_Health::get_instance();
     526
    527527// Set up current user.
    528528$GLOBALS['wp']->init();
Note: See TracChangeset for help on using the changeset viewer.