wp_update_nav_menu_item ( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array() )

  • (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.
  • (int|WP_Error) The menu item's database ID or WP_Error object on failure.
Defined at:


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()`.

Related Functions

wp_setup_nav_menu_item, wp_save_nav_menu_items, wp_update_nav_menu_object, wp_get_nav_menu_items, _wp_delete_tax_menu_item

Top Google Results

User discussions

wpseek mobile