From c459098d7b5f382693b750162fd12b251c2fba8d Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Wed, 17 May 2023 09:44:18 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@55818 git-svn-id: http://core.svn.wordpress.org/trunk@55330 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 6b361aaa5e..921c24c383 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -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(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index af7183763a..05eb5b160c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55817'; +$wp_version = '6.3-alpha-55818'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.