Automattic\WooCommerce\Admin\API
ProductVariations::register_routes
Register the routes for products.
Метод класса: ProductVariations{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ProductVariations = new ProductVariations(); $ProductVariations->register_routes();
Код ProductVariations::register_routes() ProductVariations::register routes WC 11.1.2
public function register_routes() {
parent::register_routes();
// Add a route for listing variations without specifying the parent product ID.
register_rest_route(
$this->namespace,
'/variations',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}