wp_add_nav_menu_item WordPress Action Hook
The wp_add_nav_menu_item hook allows you to add a new item to an existing WordPress menu. This hook is typically used in conjunction with the wp_nav_menu_item_custom_fields and wp_update_nav_menu_item hooks.
do_action( 'wp_add_nav_menu_item', int $menu_id , int $menu_item_db_id , array $args ) #
Fires immediately after a new navigation menu item has been added.
Description
See also
Parameters
- $menu_id
(int)ID of the updated menu.
- $menu_item_db_id
(int)ID of the new menu item.
- $args
(array)An array of arguments used to update/add the menu item.
Source
File: wp-includes/nav-menu.php
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |