Automattic\WooCommerce\Admin

DataSourcePoller::read_specs_from_data_sources()publicWC 1.0

Reads the data sources for specs and persists those specs.

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

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

Возвращает

true|false. Whether any specs were read.

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

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

Код DataSourcePoller::read_specs_from_data_sources() WC 6.6.1

public function read_specs_from_data_sources() {
	$specs        = array();
	$data_sources = apply_filters( self::FILTER_NAME, $this->data_sources, $this->id );

	// Note that this merges the specs from the data sources based on the
	// id - last one wins.
	foreach ( $data_sources as $url ) {
		$specs_from_data_source = self::read_data_source( $url );
		$this->merge_specs( $specs_from_data_source, $specs, $url );
	}

	// Persist the specs as a transient.
	set_transient(
		$this->args['transient_name'],
		$specs,
		$this->args['transient_expiry']
	);

	return 0 !== count( $specs );
}