Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_get_non_cached_ids() WordPress Function

The get_non_cached_ids() function is used to retrieve a list of post IDs that are not cached. This can be useful for retrieving a list of posts that need to be updated.

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

Retrieve 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.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/functions.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More