WC_Helper_Admin::get_featured()public staticWC 1.0

Fetch featured products from WooCommerce.com and serve them as JSON.

Method of the class: WC_Helper_Admin{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Helper_Admin::get_featured();

WC_Helper_Admin::get_featured() code WC 9.7.1

public static function get_featured() {
	$featured = WC_Admin_Addons::fetch_featured();

	if ( is_wp_error( $featured ) ) {
		wp_send_json_error( array( 'message' => $featured->get_error_message() ) );
	}

	wp_send_json( $featured );
}