Disable the new editor for variable products. (#39780)

* Disable the new editor for variable products with the dev feature flag disabled.

* Add changelog
This commit is contained in:
AnnaMag 2023-08-18 14:26:56 +02:00 committed by GitHub
parent 74beca459e
commit afc8e0fac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
[Product Block Editor] Disable the new editor for variable products.

View File

@ -25,7 +25,7 @@ class Init {
* *
* @var array * @var array
*/ */
private $supported_post_types = array( 'simple', 'variable' ); private $supported_post_types = array( 'simple' );
/** /**
* Redirection controller. * Redirection controller.
@ -38,6 +38,10 @@ class Init {
* Constructor * Constructor
*/ */
public function __construct() { public function __construct() {
if ( Features::is_enabled( 'product-variation-management' ) ) {
array_push($this->supported_post_types, 'variable');
}
$this->redirection_controller = new RedirectionController( $this->supported_post_types ); $this->redirection_controller = new RedirectionController( $this->supported_post_types );
if ( \Automattic\WooCommerce\Utilities\FeaturesUtil::feature_is_enabled( 'product_block_editor' ) ) { if ( \Automattic\WooCommerce\Utilities\FeaturesUtil::feature_is_enabled( 'product_block_editor' ) ) {