From 3a2e24bab4b77dccfa6c7ff425b739d9eaf53885 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 10 Apr 2020 03:55:08 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@47568 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-settings.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-settings.php b/src/wp-settings.php index 663c7d8eb9..77bfeced23 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -366,12 +366,6 @@ if ( ! is_multisite() ) { wp_recovery_mode()->initialize(); } -// Create an instance of WP_Site_Health so that Cron events may fire. -if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; -} -WP_Site_Health::get_instance(); - // Load active plugins. foreach ( wp_get_active_and_valid_plugins() as $plugin ) { wp_register_plugin_realpath( $plugin ); @@ -524,6 +518,12 @@ unset( $theme ); */ do_action( 'after_setup_theme' ); +// Create an instance of WP_Site_Health so that Cron events may fire. +if ( ! class_exists( 'WP_Site_Health' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; +} +WP_Site_Health::get_instance(); + // Set up current user. $GLOBALS['wp']->init();