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:
kate522 committed 2026-07-11 18:22:10 +08:00
1 parent e0b60fb3ea
commit 3d021d08f6
3 files changed
+198 -33

No files matched your search

@@ -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',