wp_update_nav_menu_item


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

Parameters:
  • (int) menu_id The ID of the menu. 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.
  • (bool) fire_after_hooks Whether to fire the after insert hooks. Default true.
Returns:
  • (int|WP_Error) The menu item's database ID or WP_Error object on failure.
Defined at:
Change Log:
  • 5: .

Description

Saves 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 to APIs that expect slashed data.

Related Functions

wp_save_nav_menu_items, wp_setup_nav_menu_item, wp_update_nav_menu_object, wp_get_nav_menu_items, _wp_delete_tax_menu_item

Top Google Results

User discussions

wpseek mobile