From 0670401bae9f5e5281b502b77ef98a9371fc100c Mon Sep 17 00:00:00 2001
From: spacedmonkey <spacedmonkey@git.wordpress.org>
Date: Fri, 19 May 2023 12:46:24 +0000
Subject: [PATCH] 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.
Built from https://develop.svn.wordpress.org/trunk@55826


git-svn-id: http://core.svn.wordpress.org/trunk@55338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-includes/meta.php    | 5 ++---
 wp-includes/version.php | 2 +-
 wp-settings.php         | 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/wp-includes/meta.php b/wp-includes/meta.php
index 921c24c383..2b5ca02696 100644
--- a/wp-includes/meta.php
+++ b/wp-includes/meta.php
@@ -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();
 	}
 
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 3d5ddff634..eb89eaa02e 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '6.3-alpha-55825';
+$wp_version = '6.3-alpha-55826';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-settings.php b/wp-settings.php
index 3763dd825f..6a7e809872 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -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';