Fix WooCommerce mobile menu for new navigation (https://github.com/woocommerce/woocommerce-admin/pull/6096)
* Show the first WooCommerce item in WP menu on mobile * Hide excluded menu items from WooCommerce wp menu
This commit is contained in:
parent
c98e3ca343
commit
828ffc8a1a
|
@ -7,5 +7,11 @@ body.js:not(.has-woocommerce-navigation) {
|
|||
|
||||
.toplevel_page_woocommerce ul.wp-submenu {
|
||||
display: none;
|
||||
|
||||
@include breakpoint( '<782px' ) {
|
||||
.wp-first-item.hide-if-js {
|
||||
display: list-item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -494,8 +494,15 @@ class Menu {
|
|||
return;
|
||||
}
|
||||
|
||||
foreach ( $submenu['woocommerce'] as $menu_item ) {
|
||||
foreach ( $submenu['woocommerce'] as $key => $menu_item ) {
|
||||
if ( in_array( $menu_item[2], CoreMenu::get_excluded_items(), true ) ) {
|
||||
// phpcs:disable
|
||||
if ( ! isset( $menu_item[ self::CSS_CLASSES ] ) ) {
|
||||
$submenu['woocommerce'][ $key ][] .= ' hide-if-js';
|
||||
} else {
|
||||
$submenu['woocommerce'][ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
|
||||
}
|
||||
// phpcs:enable
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue