WordPress.org

Make WordPress Core

Changeset 44925


Ignore:
Timestamp:
03/18/2019 03:47:36 PM (6 months ago)
Author:
flixos90
Message:

Multisite: Ensure site meta caches are not primed unless the wp_blogmeta table is available.

Prior to this change, querying sites early in the bootstrap process could potentially cause a fatal error, since at that stage the filter to bail on updating site meta cache if the respective database table has not been installed yet is not hooked in yet. This changeset forces the filter to be added if that is not already the case.

Props spacedmonkey.
Fixes #46167.

File:
1 edited

Legend:

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

    r44806 r44925  
    381381 */
    382382function update_sitemeta_cache( $site_ids ) {
     383    // Ensure this filter is hooked in even if the function is called early.
     384    if ( ! has_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ) ) {
     385        add_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' );
     386    }
    383387    return update_meta_cache( 'blog', $site_ids );
    384388}
Note: See TracChangeset for help on using the changeset viewer.