WordPress at a glance
function is not described

_prime_network_caches() WP 4.6.0

Adds any networks from the given IDs to the cache that do not already exist in cache.

No Hooks.

Return

Null. Nothing.

Usage

_prime_network_caches( $network_ids );
$network_ids(array) (required)
Array of network IDs.

Notes

  • See: update_network_cache()
  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 4.6.0 Introduced.

Code of _prime_network_caches() WP 5.5.1

<?php
function _prime_network_caches( $network_ids ) {
	global $wpdb;

	$non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' );
	if ( ! empty( $non_cached_ids ) ) {
		$fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

		update_network_cache( $fresh_networks );
	}
}