Summery Summery

Save the properties of a menu item or create a new one.

Syntax Syntax

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

Description Description

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

Parameters Parameters


(int) (Required) The ID of the menu. Required. If "0", makes the menu item a draft orphan.


(int) (Required) The ID of the menu item. If "0", creates a new menu item.


(array) (Optional) The menu item's data.

Default value: array()

Return Return

(int|WP_Error) The menu item's database ID or WP_Error object on failure.

Source Source

File: wp-includes/nav-menu.php



Changelog Changelog

Version Description
3.0.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.