I found the answer in nav-menu.php, it wasn’t too complicated.
I just changed the foreach loop content like this :
if($item->classes[0] == 'subdomain1' && !empty( $item->menu_item_parent )){
$item->menu_item_parent="";
}elseif($item->classes[0] == 'main' && $sub != 'domain'){
unset($items[$key]);
}
Hope it can help !
Related Posts:
- wp_get_nav_menu_items() not working with slug
- Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu
- Add Class to Specific Link in Custom Menu
- How to avoid wp_nav_menu() ID conflict?
- Highlight parent menu item when child is not in menu
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- How is custom menu hierarchy output handled?
- Creating new dynamic menu including BP links [closed]
- List parent item with all child item on child pages
- Output the aria-labelledby parameter for a nav menu child
- Hide menu items for visitors and filter based on role
- Add a “has-children” class to body tag?
- Custom Nav Walker sub-menu HTML construct
- Placing widget to menu
- How to remove trailing tags from wp_nav_menu walker
- How to scroll item in the Menu setting effectively?
- Building custom API and using wp_get_nav_menu_items to get menu items. Only works when logged in, returns nothing when I’m not
- How to display dynamic content in start_lvl function
- Partial refresh of menu in customizer not working?
- Appearance -> Menu -> Menu Structure : Add plain HTML code as an element
- Add custom -element to wp_nav_menu
- Disable automatig SVG tag from menu
- wp_nav_menu add some element to container
- next_post_link() on custom menu structure
- Different fields available for different sites when when customising Menu’s
- Custom walker with hashes instead of links (one-page layout)
- Custom menu deletes itself
- Find out if a page has no parent
- wp_nav_menu() showing list in a different Position?
- show different admin menu to different user roles
- How to include a third level with wp_get_nav_menu_items function
- Can’t include Language switch in Nav Menu
- Using website header, menu and footer on WordPress blog
- Bulk Custom Menu and Wp-Ecommerce
- Can only get one of two custom menus to display
- Reuse a custom WordPress menu on another WordPress website
- How to dynamically populate a dropdown
- wp_nav_menu not working [closed]
- Default WordPress menu content
- how do i change the text under a navigation menu [closed]
- How should I build a custom menu walker for this setup?
- Remove admin menu
- Dynamic_sidebar inside wp_nav_menu
- Limit User Iinterface for Admin?
- Creating menu and breadcrumb “sections” within WordPress 3 being used as a CMS
- Hide menu from homepage
- changing theme folder name breaks menus – twentyeleven
- Submenu in sidebar custom page template
- How to add a second custom menu in my sidebar when theme only supports one?
- add_filter for where statment issue
- Unable to get menu pattern using a walker
- Menu not adding the right items
- get only the item you click on
- How to add columns to wordpress menu editor
- Output Post ID for all nav_items
- How can I add a class to a nav menu when I’m viewing a child page?
- Removing a page from the header menu
- Splitting up a submenu into columns, or putting existing menus in another menu as submenu item
- wp_nav_menu does not take arguments?
- “Widgets” menu doesn’t appear
- WordPress always display the first menu
- Walker_Nav_Menu creating too many closing tags?
- Can’t insert internal links and menu errors appearing
- horizontal menu / 4-level depth
- 500 Internal Server Error when Trying to Save Menu [closed]
- Theme Menu vs Native Menu
- How do I convert a custom menu wp_get_nav_menu_items into Fourth level?
- Custom menu including also primary menu items
- Need to remove the admin menu item from a be theme in wordpress
- How to add CSS class to and and id in a nav menu with code?
- How to add Loginout to Sub-menu
- having a page in multi sub-menu and match current-menu-item
- PHP Warning adding menu
- Roles see different top menu (nav menu)
- Output existing wp_nav_menu with a custom walker
- Customize version different to Live version
- Sub-Items Not Visible in Navigation
- Custom menu with Walker class – what should the $db_fields be?
- Has there been any improvements to wp’s menu handling?
- Eliminate menu collapse button on website
- Best way to build a 500 item menu
- Count Level 1 Childs for Custom Nav Walker WordPress
- Iterate through each menu item into a shortcode
- Showing main menu and child menu in diffent places in a same page
- “Static” Child Menu with Accordian
- Display same menu for parent and all its children
- Image menu on responsive WordPress
- Set a different home link in nav menu
- Specifying Class style for Menu
- Auto Filled Custom Menus for Custom Post Types?
- How to view menu and submenus in URL
- Permalinks linking to similar named site
- Adding Pages to Menus – No Page Hierarchy in Backend [duplicate]
- Custom navigation / menu output (walker?)
- How does WP knows which template to use for a page
- Problems with draft website pages
- Active Navigation Class Based on URL on icon
- Rename Menu icon in Twenty seventeen theme
- WordPress Menu – Adding a new dynamic element to the menu
- One item on menu is not clickable when it should be