WordPress.org

Make WordPress Core

Changeset 47569


Ignore:
Timestamp:
04/10/2020 03:57:12 AM (5 months 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().

Brings [47568] to the 5.4 branch.

Fixes #49824.

Props peterwilsoncc, whyisjake.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/src/wp-settings.php

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