I believe the filter you want is wp_get_nav_menus
:
function wp_get_nav_menus( $args = array() ) {
$defaults = array( 'hide_empty' => false, 'orderby' => 'name' );
$args = wp_parse_args( $args, $defaults );
/**
* Filter the navigation menu objects being returned.
*
* @since 3.0.0
*
* @see get_terms()
*
* @param array $menus An array of menu objects.
* @param array $args An array of arguments used to retrieve menu objects.
*/
return apply_filters( 'wp_get_nav_menus', get_terms( 'nav_menu', $args), $args );
}
The wp_get_nav_menus()
function is used on line 383 of wp-admin-nav-menus.php
to set the $nav_menus
variable which is used throughout the file in a number of places, so be very careful what you do.
Related Posts:
- Hook for number of items in Appearance > Menus > CustomPostType > View All [duplicate]
- Changing the Order of Admin Menu Sections?
- Adding an Arbitrary Link to the Admin Menu?
- Add separator to admin submenu
- On which hook should I be calling register_nav_menu(s)?
- Renaming a WordPress Admin Menu
- How do I fix this error: Warning: invalid argument supplied for foreach()?
- How to add menu to Dashboard that can be viewed by all users
- Make Theme automatically choose default nav menu
- Move admin menu at the end
- Hide pages depending on role
- How to display custom post meta in the appearance->menus page
- How can I get an array/list of all current WordPress Admin Menu items?
- how to only add a top-level admin menu without it creating a sub-level-menu
- Adding custom text in items titles from wp_nav_menu()
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- Remove Metabox from Menus screen
- Sort wp_nav_menu() by menu order
- Custom Admin Menu Order
- Disabling ‘posts’ in Appearance > Menus
- Hiding Admin Page While Keeping Menu Expanded
- Third level navigation class
- Get admin menu link
- SlideDeck 2, make back-end visible for admins only
- Limit the menu child levels under “admin > appearance > menus”
- current-menu-item class not working properly
- Ad custom admin page like WordPress customizer [closed]
- Admin menu structure
- Appearance Menus Screen – menu item drop down menu not functioning
- Adding an admin menu page showing the link twice – how to solve this?
- Admin-ajax.php 500 error when Add to menu is clicked in admin
- Can I have custom post types in “Add menu items” on in the Admin > Appearance > Menu
- Add Labels to Admin Menu ( How To )
- How can I make a menu link visible only to admins (without plugins)?
- Is there a hook for nav menu item links to add custom css programatically?
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- Add a counter beside menu item label
- Adding top level items in the admin menu that link to a post
- How to get submenu of admin menu?
- Strange menu behaviour wordpress admin [duplicate]
- Adding CSS-class to WordPress Menu in backend
- Menu deletes all items and position – wordpress bug?
- Plugins & Setting Menu Items Removed From Admin Panel
- add_menu_page does not render the expected result
- Admin Menu Hack (Left side in Dashboard)
- Lost admin “manage_link” capability WordPress. No “Links” menu item in admin menu
- Removing Submenu from Menu
- Admin menu in different languages
- insert an HTML element if there is a submenu only
- Need to remove the admin menu item from a be theme in wordpress
- Add category label for appearance > menus items
- Removing wp admin menu item on top bar of admin backend
- display cart information within li of cart menu item
- Links in new menu don’t work
- Admin page and admin menu. Permissions plugin
- wp_is_mobile() inside js
- Appearance > Menus
- Customizing label/title output of admin nav_menu selecter
- Is It Possible To A Link To The Homepage From The Admin Sidebar?
- Query for menus in backend (BE)
- List of WordPress menu item indices?
- How do I fix the URL used in the WordPress admin menu for customize.php
- How to handle change the appearance of ‘categories’ box on dashboard?
- How can I disable sorting/dragging of a menu item in the custom menu admin?
- How to modify menu text in callback function of ‘walker_nav_menu_start_el’ hook
- How to change the markup created by menu item only on chosen items?
- Get_avatar filter hook not displaying custom avatar image on frontend
- Displaying a Custom Avatar in WP Bootstrap Navwalker Menus in WordPress
- How to change WP menu item type?
- Add button and title on submenu WordPress
- Show current navigation path from menu
- Exclude one item from wp_list_pages( $args );
- Remove the whole menu in the admin
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How to give custom classes to the WordPress Menu widget
- Menu in left side don’t appears with dropdown
- Create custom page and add it in nav menu by code
- Submenu items not showing anymore on the navigation
- superfish.js seems it is not working properly after wordpress upgarde to 4.6.1
- Mobile screen does not display Primary navbar…just a three line icon [closed]
- Using Different wp_nav_menu theme_location based on page id (or a parent id)
- Display Menu Navigation Label
- Menu is not displaying on the site navigation [closed]
- Updated WordPress, now Navigation is Messed Up
- wp_nav_menu removing containing UL with ‘items_wrap’ => ‘%3$s’ not working
- How to show only current item children using wp_nav_menu?
- Copied site has wrong menu URL behaviour
- WPML CMS Nav and Custom Nav_Walker Undefined Property Notices [closed]
- Is it possible to seperate wordpress menu by different div?
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- how to display wordpress navbar with top menu outside wordpress system
- Menus not showing in the admin menu, after save
- Customize Walker_nav_menu to show posts if item is category
- Add Protocol to Custom Menus
- Change menu item order
- Menu System: Custom Links
- Formatting WordPress Menus (without bullets, inline with text)
- Change Menu Order
- Critical Error when editing menu