- fixed conditional menu handlers for MegaMenu themes (#1334);

This commit is contained in:
Mykyta Synelnikov
2024-01-04 00:54:19 +02:00
parent 2c2fde8c83
commit c01254213b
+6 -1
View File
@@ -64,7 +64,12 @@ if ( ! is_admin() ) {
foreach ( $menu_items as $item ) {
if ( empty( $item->ID ) ) {
// Left item with empty ID for the cases like in MegaMenu when generated submenu doesn't have the menu item ID.
$filtered_items[] = $item;
if ( ! empty( $item->is_mega_menu ) ) {
if ( isset( $item->menu_item_parent ) && in_array( absint( $item->menu_item_parent ), $hide_children_of, true ) ) {
continue;
}
$filtered_items[] = $item;
}
continue;
}