Skip to content

Commit

Permalink
Networks and Sites: Load WP_Metadata_Lazyloader class file if class…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
spacedmonkey committed May 19, 2023
1 parent 23b007b commit 7d96c1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/wp-includes/meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @subpackage Meta
*/

require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';

/**
* Adds metadata for the specified object.
*
Expand Down Expand Up @@ -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();
}

Expand Down
1 change: 0 additions & 1 deletion src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
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';
Expand Down

0 comments on commit 7d96c1d

Please sign in to comment.