Commit 41b86a40ef8 for woocommerce
commit 41b86a40ef8a09eeccd229b2c549e97499d322aa
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date: Mon Jun 8 11:15:27 2026 +0200
Remove WC Brands code related to the deprecated product editor (#65562)
* Remove WC Brands code related to the deprecated product editor
* Add changelog
* Update PHPStan
diff --git a/plugins/woocommerce/changelog/remove-brands-beta-product-editor b/plugins/woocommerce/changelog/remove-brands-beta-product-editor
new file mode 100644
index 00000000000..dd9d9828c9f
--- /dev/null
+++ b/plugins/woocommerce/changelog/remove-brands-beta-product-editor
@@ -0,0 +1,5 @@
+Significance: patch
+Type: tweak
+Comment: Remove WC Brands code related to the deprecated product editor
+
+
diff --git a/plugins/woocommerce/includes/class-wc-brands.php b/plugins/woocommerce/includes/class-wc-brands.php
index 623d0e06b66..5cb18913dba 100644
--- a/plugins/woocommerce/includes/class-wc-brands.php
+++ b/plugins/woocommerce/includes/class-wc-brands.php
@@ -78,9 +78,6 @@ class WC_Brands {
add_action( 'woocommerce_product_set_stock_status', array( $this, 'recount_after_stock_change' ) );
add_action( 'woocommerce_update_options_products_inventory', array( $this, 'recount_all_brands' ) );
- // Product Editor compatibility.
- add_action( 'woocommerce_layout_template_after_instantiation', array( $this, 'wc_brands_on_block_template_register' ), 10, 3 );
-
// Block theme integration.
add_filter( 'hooked_block_types', array( $this, 'hook_product_brand_block' ), 10, 4 );
add_filter( 'hooked_block_core/post-terms', array( $this, 'configure_product_brand_block' ), 10, 5 );
@@ -1099,35 +1096,6 @@ class WC_Brands {
}
}
- /**
- * Add a new block to the template.
- *
- * @param string $template_id Template ID.
- * @param string $template_area Template area.
- * @param BlockTemplateInterface $template Template instance.
- */
- public function wc_brands_on_block_template_register( $template_id, $template_area, $template ) {
-
- if ( 'simple-product' === $template->get_id() ) {
- $section = $template->get_section_by_id( 'product-catalog-section' );
- if ( $section !== null ) {
- $section->add_block(
- array(
- 'id' => 'woocommerce-brands-select',
- 'blockName' => 'woocommerce/product-taxonomy-field',
- 'order' => 15,
- 'attributes' => array(
- 'label' => __( 'Brands', 'woocommerce-brands' ),
- 'createTitle' => __( 'Create new brand', 'woocommerce-brands' ),
- 'slug' => 'product_brand',
- 'property' => 'brands',
- ),
- )
- );
- }
- }
- }
-
/**
* Hooks the product brand terms block into single product templates.
*
diff --git a/plugins/woocommerce/phpstan-baseline.neon b/plugins/woocommerce/phpstan-baseline.neon
index 800c230cf69..75f51d67197 100644
--- a/plugins/woocommerce/phpstan-baseline.neon
+++ b/plugins/woocommerce/phpstan-baseline.neon
@@ -9294,18 +9294,6 @@ parameters:
count: 2
path: includes/class-wc-brands.php
- -
- message: '#^Call to method get_id\(\) on an unknown class BlockTemplateInterface\.$#'
- identifier: class.notFound
- count: 1
- path: includes/class-wc-brands.php
-
- -
- message: '#^Call to method get_section_by_id\(\) on an unknown class BlockTemplateInterface\.$#'
- identifier: class.notFound
- count: 1
- path: includes/class-wc-brands.php
-
-
message: '#^Cannot access property \$labels on WP_Taxonomy\|false\.$#'
identifier: property.nonObject
@@ -9498,12 +9486,6 @@ parameters:
count: 1
path: includes/class-wc-brands.php
- -
- message: '#^Method WC_Brands\:\:wc_brands_on_block_template_register\(\) has no return type specified\.$#'
- identifier: missingType.return
- count: 1
- path: includes/class-wc-brands.php
-
-
message: '#^Parameter \#1 \$args of function get_terms expects array\{taxonomy\?\: array\<string\>\|string, object_ids\?\: array\<int\>\|int, orderby\?\: string, order\?\: string, hide_empty\?\: bool\|int, include\?\: array\<int\>\|string, exclude\?\: array\<int\>\|string, exclude_tree\?\: array\<int\>\|string, \.\.\.\}, ''product_brand'' given\.$#'
identifier: argument.type
@@ -9534,12 +9516,6 @@ parameters:
count: 2
path: includes/class-wc-brands.php
- -
- message: '#^Parameter \$template of method WC_Brands\:\:wc_brands_on_block_template_register\(\) has invalid type BlockTemplateInterface\.$#'
- identifier: class.notFound
- count: 1
- path: includes/class-wc-brands.php
-
-
message: '#^Cannot access property \$ID on WP_Post\|null\.$#'
identifier: property.nonObject