wp_update_nav_menu
Fires after a navigation menu has been successfully updated.
Usage
add_action( 'wp_update_nav_menu', 'wp_kama_update_nav_menu_action', 10, 2 ); /** * Function for `wp_update_nav_menu` action-hook. * * @param int $menu_id ID of the updated menu. * @param array $menu_data An array of menu data. * * @return void */ function wp_kama_update_nav_menu_action( $menu_id, $menu_data ){ // action... }
- $menu_id(int)
- ID of the updated menu.
- $menu_data(array)
- An array of menu data.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
wp_update_nav_menu
wp_update_nav_menu
wp_update_nav_menu
wp-includes/nav-menu.php 402
do_action( 'wp_update_nav_menu', $menu_id, $menu_data );
wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php 450
do_action( 'wp_update_nav_menu', $menu_id );
wp-admin/includes/nav-menu.php 1492
do_action( 'wp_update_nav_menu', $nav_menu_selected_id );