wordpress / latest / functions / _get_non_cached_ids.html

_get_non_cached_ids( int[] $object_ids, string $cache_key ): int[]

Retrieves IDs that are not already present in the cache.

Parameters

$object_ids int[] Required
Array of IDs.
$cache_key string Required
The cache bucket to check against.

Return

int[] Array of IDs not present in the cache.

Source

File: wp-includes/functions.php. View all references

function _get_non_cached_ids( $object_ids, $cache_key ) {
	$non_cached_ids = array();
	$cache_values   = wp_cache_get_multiple( $object_ids, $cache_key );

	foreach ( $cache_values as $id => $value ) {
		if ( ! $value ) {
			$non_cached_ids[] = (int) $id;
		}
	}

	return $non_cached_ids;
}

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
6.1.0 This function is no longer marked as "private".
3.4.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_get_non_cached_ids