update_sitemeta_cache() WordPress Function

The update_sitemeta_cache() function is used to update the cache of site meta data. This function will fetch the site meta data from the database and store it in the cache. This function is typically called when a site is first created or when the site meta data is updated.

update_sitemeta_cache( array $site_ids ) #

Updates metadata cache for list of site IDs.


Description

Performs SQL query to retrieve all metadata for the sites matching $site_ids and stores them in the cache. Subsequent calls to get_site_meta() will not need to query the database.


Top ↑

Parameters

$site_ids

(array)(Required)List of site IDs.


Top ↑

Return

(array|false) An array of metadata on success, false if there is nothing to update.


Top ↑

Source

File: wp-includes/ms-site.php

function update_sitemeta_cache( $site_ids ) {
	// Ensure this filter is hooked in even if the function is called early.
	if ( ! has_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ) ) {
		add_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' );
	}
	return update_meta_cache( 'blog', $site_ids );
}


Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.