On this page
_get_non_cached_ids( int[] $object_ids, string $cache_key ): int[]
Retrieves IDs that are not already present in the cache.
Parameters
$object_idsint[] Required-
Array of IDs.
$cache_keystring 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;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_cache_get_multiple() wp-includes/cache.php | Retrieves multiple values from the cache in one call. |
Used By
| Used By | Description |
|---|---|
| _prime_term_caches() wp-includes/taxonomy.php | Adds any terms from the given IDs to the cache that do not already exist in cache. |
| _prime_network_caches() wp-includes/ms-network.php | Adds any networks from the given IDs to the cache that do not already exist in cache. |
| _prime_site_caches() wp-includes/ms-site.php | Adds any sites from the given IDs to the cache that do not already exist in cache. |
| _prime_comment_caches() wp-includes/comment.php | Adds any comments from the given IDs to the cache that do not already exist in cache. |
| cache_users() wp-includes/pluggable.php | Retrieves info for user lists to prevent multiple queries by get_userdata() . |
| _prime_post_caches() wp-includes/post.php | Adds any posts from the given IDs to the cache that do not already exist in cache. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_get_non_cached_ids