Automattic\WooCommerce\Admin\Features\MarketingRecommendations
Init::get_specs
Get specs or fetch remotely if they don't exist.
Method of the class: Init{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Init::get_specs();
Init::get_specs() Init::get specs code WC 11.2.2
public static function get_specs() {
if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
return DefaultMarketingRecommendations::get_all();
}
$specs = MarketingRecommendationsDataSourcePoller::get_instance()->get_specs_from_data_sources();
// Fetch specs if they don't yet exist.
if ( ! is_array( $specs ) || 0 === count( $specs ) ) {
return DefaultMarketingRecommendations::get_all();
}
return $specs;
}