Automattic\WooCommerce\Admin\API
ProductVariations::register_routes()
Register the routes for products.
Method of the class: ProductVariations{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ProductVariations = new ProductVariations(); $ProductVariations->register_routes();
ProductVariations::register_routes() ProductVariations::register routes code WC 8.7.0
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' ), ) ); }