Make WordPress Core

Changeset 55818


Ignore:
Timestamp:
05/17/2023 09:42:02 AM (17 months ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/meta.php

    r55398 r55818  
    12151215
    12161216    if ( null === $wp_metadata_lazyloader ) {
     1217        if ( ! class_exists( 'WP_Metadata_Lazyloader' ) ) {
     1218            require_once ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php';
     1219        }
    12171220        $wp_metadata_lazyloader = new WP_Metadata_Lazyloader();
    12181221    }
Note: See TracChangeset for help on using the changeset viewer.