Dequeue conflicting styles within product editor (#39478)
* Dequeue conflicting styles within product editor * Add changelog * Fix lint errors * Add check to only dequeue on admin/embed pages
This commit is contained in:
parent
e9042633eb
commit
1ac824de2d
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Dequeue blocktheme styles on WooCommerce Admin pages when product block editor is enabled.
|
|
@ -43,6 +43,7 @@ class Init {
|
||||||
if ( \Automattic\WooCommerce\Utilities\FeaturesUtil::feature_is_enabled( 'product_block_editor' ) ) {
|
if ( \Automattic\WooCommerce\Utilities\FeaturesUtil::feature_is_enabled( 'product_block_editor' ) ) {
|
||||||
if ( ! Features::is_enabled( 'new-product-management-experience' ) ) {
|
if ( ! Features::is_enabled( 'new-product-management-experience' ) ) {
|
||||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
|
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
|
||||||
|
add_action( 'admin_enqueue_scripts', array( $this, 'dequeue_conflicting_styles' ), 100 );
|
||||||
add_action( 'get_edit_post_link', array( $this, 'update_edit_product_link' ), 10, 2 );
|
add_action( 'get_edit_post_link', array( $this, 'update_edit_product_link' ), 10, 2 );
|
||||||
}
|
}
|
||||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||||
|
@ -111,6 +112,17 @@ class Init {
|
||||||
do_action( 'enqueue_block_editor_assets' );
|
do_action( 'enqueue_block_editor_assets' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dequeue conflicting styles.
|
||||||
|
*/
|
||||||
|
public function dequeue_conflicting_styles() {
|
||||||
|
if ( ! PageController::is_admin_or_embed_page() ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Dequeing this to avoid conflicts, until we remove the 'woocommerce-page' class.
|
||||||
|
wp_dequeue_style( 'woocommerce-blocktheme' );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the edit product links when the new experience is enabled.
|
* Update the edit product links when the new experience is enabled.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue