wp_update_nav_menu_item
wp_update_nav_menu_item ( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array() )
Parameters:- (int) menu_id The ID of the menu. Required. If "0", makes the menu item a draft orphan.
- (int) menu_item_db_id The ID of the menu item. If "0", creates a new menu item.
- (array) menu_item_data The menu item's data.
Returns:- (int|WP_Error) The menu item's database ID or WP_Error object on failure.
Defined at: - Introduced in WordPress: 3.0.0
- Deprecated in WordPress: —
Description
Save the properties of a menu item or create a new one.The menu-item-title, menu-item-description, and menu-item-attr-title are expected
to be pre-slashed since they are passed directly into `wp_insert_post()`.