On this page
update_sitemeta_cache( array $site_ids ): array|false
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.
Parameters
$site_idsarray Required-
List of site IDs.
Return
array|false An array of metadata on success, false if there is nothing to update.
Source
File: wp-includes/ms-site.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| has_filter() wp-includes/plugin.php | Checks if any filter has been registered for a hook. |
| update_meta_cache() wp-includes/meta.php | Updates the metadata cache for the specified objects. |
| add_filter() wp-includes/plugin.php | Adds a callback function to a filter hook. |
Used By
| Used By | Description |
|---|---|
| update_site_cache() wp-includes/ms-site.php | Updates sites in cache. |
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_sitemeta_cache