wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_get_non_cached_ids › WordPress Function

Seit3.4.0
Veraltetn/v
_get_non_cached_ids ( $object_ids, $cache_group )
Parameter: (2)
  • (int[]) $object_ids Array of IDs.
    Erforderlich: Ja
  • (string) $cache_group The cache group to check against.
    Erforderlich: Ja
Gibt zurück:
  • (int[]) Array of IDs not present in the cache.
Definiert in:
Codex:
Changelog:
  • 6.1.0

Retrieves IDs that are not already present in the cache.



Quellcode

function _get_non_cached_ids( $object_ids, $cache_group ) {
	$object_ids = array_filter( $object_ids, '_validate_cache_id' );
	$object_ids = array_unique( array_map( 'intval', $object_ids ), SORT_NUMERIC );

	if ( empty( $object_ids ) ) {
		return array();
	}

	$non_cached_ids = array();
	$cache_values   = wp_cache_get_multiple( $object_ids, $cache_group );

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

	return $non_cached_ids;
}