Automattic\WooCommerce\Admin

DataSourcePoller::get_specs_from_data_sources()publicWC 1.0

Reads the data sources for specs and persists those specs.

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

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

Возвращает

Массив. list of specs.

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

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

Код DataSourcePoller::get_specs_from_data_sources() WC 7.3.0

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

	if ( ! is_array( $specs ) || empty( $specs ) ) {
		$this->read_specs_from_data_sources();
		$specs_group = get_transient( $this->args['transient_name'] );
		$specs       = isset( $specs_group[ $locale ] ) ? $specs_group[ $locale ] : array();
	}
	$specs = apply_filters( self::FILTER_NAME_SPECS, $specs, $this->id );
	return $specs !== false ? $specs : array();
}