wp_add_nav_menu_item WordPress Action Hook

The wp_add_nav_menu_item hook allows you to add a new item to an existing WordPress menu. This hook is typically used in conjunction with the wp_nav_menu_item_custom_fields and wp_update_nav_menu_item hooks.

do_action( 'wp_add_nav_menu_item', int $menu_id, int $menu_item_db_id, array $args ) #

Fires immediately after a new navigation menu item has been added.


Description

Top ↑

See also


Top ↑

Parameters

$menu_id

(int)ID of the updated menu.

$menu_item_db_id

(int)ID of the new menu item.

$args

(array)An array of arguments used to update/add the menu item.


Top ↑

Source

File: wp-includes/nav-menu.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.