Files
wp-graphql-woocommerce/includes/mutation/class-product-category-update.php
e3ca7f895e feat: Add support for brands (#918) (#964)
* feat: Add support for brands (#918)

* feat: add product brand support with where args, taxonomy filter, and taxonomy mutation input fields

- Register product_brand taxonomy with WPGraphQL (fix indentation from #964)
- Add productBrand/productBrandIn/productBrandNotIn/productBrandId/productBrandIdIn/productBrandIdNotIn
  where args on products connection
- Add product_brand to taxonomy args map and case statements in product connection resolver
- Register additional input fields (display, menuOrder, imageId) on
  CreateProductCategoryInput and UpdateProductCategoryInput mutations
- Split ProductTaxonomyQueriesTest into ProductCategoryQueriesTest,
  ProductTagQueriesTest, ProductCategoryMutationsTest, ProductTagMutationsTest
- Add ProductBrandQueriesTest with 8 tests covering queries, connections,
  hierarchy, where args, taxonomy filter, and CRUD mutations

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2026-03-23 12:28:48 -04:00

32 lines
748 B
PHP

<?php
/**
* Mutation - UpdateProductCategory (additional fields)
*
* Registers additional WooCommerce-specific input fields and processes them
* on the core WPGraphQL UpdateProductCategory mutation.
*
* @package WPGraphQL\WooCommerce\Mutation
* @since 0.22.0
*/
namespace WPGraphQL\WooCommerce\Mutation;
/**
* Class - Product_Category_Update
*/
class Product_Category_Update {
/**
* Registers the additional input fields and hooks.
*
* @return void
*/
public static function register() {
register_graphql_fields(
'UpdateProductCategoryInput',
Product_Category_Create::get_input_fields()
);
add_action( 'graphql_update_product_cat', [ Product_Category_Create::class, 'process_additional_fields' ], 10, 2 );
}
}