Automattic\WooCommerce\Admin\RemoteSpecs

DataSourcePoller::get_cached_specs()publicWC 1.0

Gets specs from cache if it exists.

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

Хуки из метода

Возвращает

Массив. list of specs.

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

$DataSourcePoller = new DataSourcePoller();
$DataSourcePoller->get_cached_specs();

Код DataSourcePoller::get_cached_specs() WC 9.7.1

public function get_cached_specs() {
	$locale      = get_user_locale();
	$specs_group = get_transient( $this->args['transient_name'] ) ?? array();
	$specs       = isset( $specs_group[ $locale ] ) ? $specs_group[ $locale ] : null;

	/**
	 * Filter specs.
	 *
	 * @param array      $specs List of specs.
	 * @param string     $this->id Spec identifier.
	 *
	 * @since 8.8.0
	 */
	$specs = apply_filters( self::FILTER_NAME_SPECS, $specs, $this->id );

	return false !== $specs ? $specs : array();
}