Networks and Sites: Load WP_Metadata_Lazyloader class file if class in meta.php.

In [55818] did a check to see if `WP_Metadata_Lazyloader` class existed and the loaded in the class file if it did not. However, require in wp-settings.php was not removed and resulted in the class being loaded twice. To be safe, only include the class file in meta.php and remove from wp-settings.php file.

Props spacedmonkey, ryelle.
See #58185.

git-svn-id: https://develop.svn.wordpress.org/trunk@55826 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonny Harris
2023-05-19 12:44:54 +00:00
parent 23b007b126
commit 7d96c1d5f0
2 changed files with 2 additions and 4 deletions

View File

@@ -10,6 +10,8 @@
* @subpackage Meta
*/
require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';
/**
* Adds metadata for the specified object.
*
@@ -1214,9 +1216,6 @@ 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();
}

View File

@@ -188,7 +188,6 @@ require ABSPATH . WPINC . '/user.php';
require ABSPATH . WPINC . '/class-wp-user-query.php';
require ABSPATH . WPINC . '/class-wp-session-tokens.php';
require ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php';
require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';
require ABSPATH . WPINC . '/general-template.php';
require ABSPATH . WPINC . '/link-template.php';
require ABSPATH . WPINC . '/author-template.php';