Merge pull request #1413 from ultimatemember/fix/mega_menu_conditional

MegaMenu and conditional handlers
This commit is contained in:
Mykyta Synelnikov
2024-01-04 01:00:03 +02:00
committed by GitHub
+7
View File
@@ -63,6 +63,13 @@ if ( ! is_admin() ) {
//other filter
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.
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;
}