WC_Admin_Report::get_cached_query()protectedWC 1.0

Get the cached query result or null if it's not in the cache.

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

Хуков нет.

Возвращает

Разное.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_cached_query( $query_hash );
$query_hash(строка) (обязательный)
The query hash.

Код WC_Admin_Report::get_cached_query() WC 8.7.0

protected function get_cached_query( $query_hash ) {
	$class = strtolower( get_class( $this ) );

	if ( ! isset( self::$cached_results[ $class ] ) ) {
		self::$cached_results[ $class ] = get_transient( strtolower( get_class( $this ) ) );
	}

	if ( isset( self::$cached_results[ $class ][ $query_hash ] ) ) {
		return self::$cached_results[ $class ][ $query_hash ];
	}

	return null;
}