feat(shop): add product taxonomy write REST for editor
Expose POST /shop/products/taxonomy to create category/tag terms, enrich GET term payload with slug/parent/count, and let ProductEditorDrawer create categories and ensure tags without WP native UI.
This commit is contained in:
@@ -175,6 +175,13 @@ class AKSRT_Admin_Shop_Controller extends AKSRT_Admin_Controller_Base {
|
||||
'permission_callback' => [$this, 'check_permission'],
|
||||
]);
|
||||
|
||||
// Create product category or tag term for the product editor.
|
||||
register_rest_route(self::API_NAMESPACE, '/shop/products/taxonomy', [
|
||||
'methods' => 'POST',
|
||||
'callback' => [$this, 'create_product_taxonomy_term'],
|
||||
'permission_callback' => [$this, 'check_permission'],
|
||||
]);
|
||||
|
||||
// Product list
|
||||
register_rest_route(self::API_NAMESPACE, '/shop/products', [
|
||||
'methods' => 'GET',
|
||||
|
||||
Reference in New Issue
Block a user