A WordPress-centric search engine for devs and theme authors



_get_non_cached_ids ›

Since3.4.0
Deprecatedn/a
_get_non_cached_ids ( $object_ids, $cache_key )
Access:
  • private
Parameters: (2)
  • (int[]) $object_ids Array of IDs.
    Required: Yes
  • (string) $cache_key The cache bucket to check against.
    Required: Yes
Returns:
  • (int[]) Array of IDs not present in the cache.
Defined at:
Codex:

Retrieve IDs that are not already present in the cache.



Source

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;
}