WC_Helper_Admin::register_rest_routes
Registers the REST routes for the featured products and product previews endpoints.
Method of the class: WC_Helper_Admin{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Helper_Admin::register_rest_routes();
WC_Helper_Admin::register_rest_routes() WC Helper Admin::register rest routes code WC 10.3.6
public static function register_rest_routes() {
/* Used by the WooCommerce > Extensions > Discover page. */
register_rest_route(
'wc/v3',
'/marketplace/featured',
array(
'methods' => 'GET',
'callback' => array( __CLASS__, 'get_featured' ),
'permission_callback' => array( __CLASS__, 'get_permission' ),
)
);
/* Used to show previews of products in a modal in in-app marketplace. */
register_rest_route(
'wc/v1',
'/marketplace/product-preview',
array(
'methods' => 'GET',
'callback' => array( __CLASS__, 'get_product_preview' ),
'permission_callback' => array( __CLASS__, 'get_permission' ),
)
);
}