Automattic\WooCommerce\Internal\Api
QueryCache::get_cache_ttl
The time-to-live (in seconds) for a cached parsed query.
Reads the {@see Main::OPTION_QUERY_CACHE_TTL} store option; falls back to {@see self::DEFAULT_CACHE_TTL} when the option is unset, empty, or non-positive.
Метод класса: QueryCache{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = QueryCache::get_cache_ttl(): int;
Код QueryCache::get_cache_ttl() QueryCache::get cache ttl WC 10.9.1
public static function get_cache_ttl(): int {
$value = (int) get_option( Main::OPTION_QUERY_CACHE_TTL, self::DEFAULT_CACHE_TTL );
return $value > 0 ? $value : self::DEFAULT_CACHE_TTL;
}