WP_Object_Cache::_exists()protectedWP 3.4.0

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

Метод класса: WP_Object_Cache{}

Хуков нет.

Возвращает

true|false. Whether the key exists in the cache for the given group.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->_exists( $key, $group );
$key(int|строка) (обязательный)
Cache key to check for existence.
$group(строка) (обязательный)
Cache group for the key existence check.

Список изменений

С версии 3.4.0 Введена.

Код WP_Object_Cache::_exists() WP 6.5.2

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