WPCacheEngine::get_cached_object()publicWC 1.0

Retrieves an object cached under a given key.

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

Хуков нет.


Массив|Объект|null. The cached object, or null if there's no object cached under the passed key.


$WPCacheEngine = new WPCacheEngine();
$WPCacheEngine->get_cached_object( $key, $group );
$key(строка) (обязательный)
They key under which the object to retrieve is cached.
The group under which the object is cached.
По умолчанию: ''

Код WPCacheEngine::get_cached_object() WC 7.7.2

public function get_cached_object( string $key, string $group = '' ) {
	$prefixed_key = self::get_prefixed_key( $key, $group );
	$value        = wp_cache_get( $prefixed_key, $group );
	return false === $value ? null : $value;