mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Networks and Sites: Load WP_Metadata_Lazyloader class file if class does not exist.
Follow on from [55747]. As `get_sites` can be called very early in the bootstrap process, like in the sunrise.php file, it means that the `WP_Metadata_Lazyloader` may not have been loaded yet in the wp-settings.php file. Add a simple check to see if the class exists and if it does not exist then load the class file in. Props spacedmonkey, peterwilsoncc, dd32. See #58185. git-svn-id: https://develop.svn.wordpress.org/trunk@55818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1214,6 +1214,9 @@ function wp_metadata_lazyloader() {
|
||||
static $wp_metadata_lazyloader;
|
||||
|
||||
if ( null === $wp_metadata_lazyloader ) {
|
||||
if ( ! class_exists( 'WP_Metadata_Lazyloader' ) ) {
|
||||
require_once ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';
|
||||
}
|
||||
$wp_metadata_lazyloader = new WP_Metadata_Lazyloader();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user