W3cubDocs

/WordPress

WP_Object_Cache::_exists( int|string $key, string $group ): bool

Serves as a utility function to determine whether a key exists in the cache.

Parameters

$keyint|stringrequired
Cache key to check for existence.
$groupstringrequired
Cache group for the key existence check.

Return

bool Whether the key exists in the cache for the given group.

Source

protected function _exists( $key, $group ) {
	return isset( $this->cache[ $group ] ) && ( isset( $this->cache[ $group ][ $key ] ) || array_key_exists( $key, $this->cache[ $group ] ) );
}

Changelog

Version Description
3.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_object_cache/_exists