WordPress at a glance
function is not described

_prime_site_caches() WP 4.6.0

Adds any sites from the given ids to the cache that do not already exist in cache.

  • See: update_site_cache()
  • Global. wpdb. $wpdb WordPress database abstraction object.
  • Since 5.1.0 Introduced the $update_meta_cache parameter.

No Hooks.

Return

Nothing (null).

Usage

_prime_site_caches( $ids, $update_meta_cache );
$ids(array) (required)
ID list.
$update_meta_cache(true/false)
Whether to update the meta cache.
Default: true

Code of prime site caches: wp-includes/ms-site.php VER 5.1.1

<?php
function _prime_site_caches( $ids, $update_meta_cache = true ) {
	global $wpdb;

	$non_cached_ids = _get_non_cached_ids( $ids, 'sites' );
	if ( ! empty( $non_cached_ids ) ) {
		$fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

		update_site_cache( $fresh_sites, $update_meta_cache );
	}
}