wp_update_nav_menu_item

Advertisement

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

$menu_id

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

$menu_item_db_id

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

$menu_item_data

(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


			

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply

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