Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::get_specs()public staticWC 1.0

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

Method of the class: Init{}

No Hooks.

Return

Array. List of specs.

Usage

$result = Init::get_specs();

Init::get_specs() code WC 9.5.1

public static function get_specs() {
	if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) {
		return DefaultPromotions::get_all();
	}

	$specs = WCPayPromotionDataSourcePoller::get_instance()->get_specs_from_data_sources();
	// On empty remote specs, fallback to default ones.
	if ( ! is_array( $specs ) || 0 === count( $specs ) ) {
		$specs = DefaultPromotions::get_all();
	}

	return $specs;
}