Automattic\WooCommerce\Admin\Features\MarketingRecommendations

Init::get_misc_recommendations_specs()public staticWC 9.5.0

Get misc recommendations specs or fetch remotely if they don't exist.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = Init::get_misc_recommendations_specs();

Список изменений

С версии 9.5.0 Введена.

Код Init::get_misc_recommendations_specs() WC 9.7.1

public static function get_misc_recommendations_specs() {
	if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
		return array();
	}
	$specs = MiscRecommendationsDataSourcePoller::get_instance()->get_specs_from_data_sources();

	// Return empty specs if they don't yet exist.
	if ( ! is_array( $specs ) ) {
		return array();
	}

	return $specs;
}