Fix: Mini Cart block isn't available in the Customizer > Widget (https://github.com/woocommerce/woocommerce-blocks/pull/6201)

This commit is contained in:
Tung Du 2022-04-08 17:14:25 +07:00 committed by GitHub
parent 5415c22251
commit d5503b6e46
1 changed files with 2 additions and 3 deletions

View File

@ -190,8 +190,8 @@ final class BlockTypesController {
* Mini Cart blocks should be available in Site Editor, Widgets and frontend (is_admin function checks this) only.
*/
if (
'widgets.php' === $pagenow ||
'site-editor.php' === $pagenow || ! is_admin() ||
! is_admin() ||
in_array( $pagenow, [ 'widgets.php', 'customize.php', 'site-editor.php' ], true ) ||
! empty( $_GET['page'] ) && 'gutenberg-edit-site' === $_GET['page'] // phpcs:ignore WordPress.Security.NonceVerification
) {
$block_types[] = 'MiniCart';
@ -201,7 +201,6 @@ final class BlockTypesController {
if ( Package::feature()->is_feature_plugin_build() ) {
$block_types[] = 'Checkout';
$block_types[] = 'Cart';
}
if ( Package::feature()->is_experimental_build() ) {