WC_Helper_Admin::register_rest_routes
Registers the REST routes for the featured products and product previews endpoints.
Метод класса: WC_Helper_Admin{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WC_Helper_Admin::register_rest_routes();
Код WC_Helper_Admin::register_rest_routes() WC Helper Admin::register rest routes WC 10.3.5
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' ),
)
);
}