Automattic\WooCommerce\Admin\API
ProductAttributeTerms::register_routes
Register the routes for custom product attributes.
Метод класса: ProductAttributeTerms{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ProductAttributeTerms = new ProductAttributeTerms(); $ProductAttributeTerms->register_routes();
Код ProductAttributeTerms::register_routes() ProductAttributeTerms::register routes WC 11.0.0
public function register_routes() {
parent::register_routes();
register_rest_route(
$this->namespace,
'products/attributes/(?P<slug>[a-z0-9_\-]+)/terms',
array(
'args' => array(
'slug' => array(
'description' => __( 'Slug identifier for the resource.', 'woocommerce' ),
'type' => 'string',
),
),
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array( $this, 'get_item_by_slug' ),
'permission_callback' => array( $this, 'get_custom_attribute_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}