Automattic\WooCommerce\Admin\RemoteSpecs
DataSourcePoller::get_specs_from_data_sources
Reads the data sources for specs and persists those specs.
Method of the class: DataSourcePoller{}
Hooks from the method
Returns
Array. list of specs.
Usage
$DataSourcePoller = new DataSourcePoller(); $DataSourcePoller->get_specs_from_data_sources();
DataSourcePoller::get_specs_from_data_sources() DataSourcePoller::get specs from data sources code WC 10.5.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 ] : null;
if ( ! is_array( $specs ) ) {
$this->read_specs_from_data_sources();
$specs_group = get_transient( $this->args['transient_name'] );
$specs = isset( $specs_group[ $locale ] ) ? $specs_group[ $locale ] : array();
}
/**
* 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();
}