Automattic\WooCommerce\Internal\Admin\RemoteFreeExtensions

Init::get_specspublic staticWC 1.0

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() code WC 10.6.2

public static function get_specs() {
	if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
		return DefaultFreeExtensions::get_all();
	}
	$specs = RemoteFreeExtensionsDataSourcePoller::get_instance()->get_specs_from_data_sources();

	// Fetch specs if they don't yet exist.
	if ( false === $specs || ! is_array( $specs ) || 0 === count( $specs ) ) {
		return DefaultFreeExtensions::get_all();
	}

	return $specs;
}