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)
  • (array) $object_ids ID list.
    Required: Yes
  • (string) $cache_key The cache bucket to check against.
    Required: Yes
Returns:
  • (array) List 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 ) {
	$clean = array();
	foreach ( $object_ids as $id ) {
		$id = (int) $id;
		if ( !wp_cache_get( $id, $cache_key ) ) {
			$clean[] = $id;
		}
	}

	return $clean;
}