WC_Helper_Admin::get_featured
Fetch featured products from WooCommerce.com and serve them as JSON.
Method of the class: WC_Helper_Admin{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Helper_Admin::get_featured();
WC_Helper_Admin::get_featured() WC Helper Admin::get featured code WC 10.5.0
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 );
}