get_nav_menu_locations
will give you menu IDs keyed by location which should correspond to the $id
also passed with wp_update_nav_menu
.
add_action('wp_update_nav_menu', function ($id, $data = NULL){
foreach( get_nav_menu_locations() as $location => $menu_id ){
if( $id == $menu_id ){
echo 'location is ' . $location;
}
}
}, 10, 2);
Related Posts:
- add_action in functions.php, do_action in plugin?
- Hooking into the HTML header container
- wp_login_form() ignoring login_form action hook
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How can I see all the actions attached to an “add_action” hook?
- How to only hook on Single.php after content?
- When can you get current page ID and initialize hooks right after?
- How can I log a user out of WordPress before the page loads?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Which hook callback has priority if both plugin and theme use the same hook?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- disable active plugins for specific theme
- Use external link in the add sub menu
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- do_action and hook methods
- Is it possible to add an action to the currently running action?
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Is it possible to remove this action? (as it’s added just before it’s called)
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- How to prevent action in ajax request, when in admin side?
- template_redirect not being called when using ajax
- Can I use a method from an existing plugin as an action hook?
- Plugin custom Action Hook not working
- Making menu link open in new tab?
- What are the benefit in adding hook in the init() hook?
- Include Max mega menu Plugin into theme
- add action for displaying posts using a shortcode
- Deactivate Plugin on Theme Switch
- ‘wp_login’ action hook not working with wp-login.php file
- Where to hook my plugin’s action
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- WordPress filter that hook after each action/filter hook
- Any hook for pre-plugin-update -either bulk or single plugin update
- Insert new user with form submit ‘init’ hook
- Hooking in to replace the Sidebar/Widget areas
- How to get all of the activate_plugin action parameters?
- Calling plugin function inside custom plugin for onclick event
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- How to get post ID with hooks publish_post, new_to_publish, etc
- edit_user_profile and show_user_profile are not firing inside a class
- the_post hook is not firing for me
- Why do plugins often ask to add in to templates?
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- Plugin Development – Functions or Hooks?
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Hook for page Request?
- Are there action hooks for comments?
- WooCommerce: after install hook
- How to remove a class function from a plugin by using remove_action()?
- Advanced WordPress plugin activation detection
- How to remove products-links after the product title using remove_action
- Add action to custom Function
- Hook on creating a menu entry?
- What hook can I use to modify custom post data before it is displayed on the page?
- How to hook into action/filter call
- navigation among single posts
- I cannot include a file in my plugin settings page
- Hook from plugin doesn’t fire up from external PHP script
- update_option_{$option} not working (do function after options are saved)
- Mobile Menu and Mobile Sidebar missing
- Callback hooked to post_updated firing on new posts as well
- The function called on the wp head hook becomes null
- WordPress site hamburger menu toggle not working
- Removing Plugin Action via Theme for Non-admins
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Is it possible to disable a theme programmatically?
- {status}_{post_type} does not run correctly?
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Admin page and admin menu. Permissions plugin
- Passing a parameter to filter and action functions
- Run only on plug-in activation instead of wp_head
- Plugin Hook: Get posts
- add_media_page function not creating submenu
- change output location of plugin function using a custom hook
- OOP Plugin: Where should I place the action hooks in the class?
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Hook automatic_updates_complete to autoupdate plugin
- My wp_update_nav_menu action is firing twice
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)
- How to enable edit button in the theme’s customize UI?
- Theme or Plugin: Where should I write my code?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- Prevent WordPress installing plugins and themes via Admin
- html generated by theme exist but doesnt appear in browser
- how can I do something on new user registration?
- Display static pages instead of category, in code
- User register hook can’t access form request
- Call to a member function get_page_permastruct() on null
- Automatically put a menu on every post