wp_nav_menu_objects WordPress Filter Hook

wp_nav_menu_objects is a hook that is called when a new menu is being created. It allows for customizations to be made to the menu before it is displayed. This hook is useful for adding new items to the menu, or for modifying existing items.

apply_filters( 'wp_nav_menu_objects', array $sorted_menu_items, stdClass $args ) #

Filters the sorted list of menu item objects before generating the menu’s HTML.


Parameters

$sorted_menu_items

(array)The menu items, sorted by each menu item's menu order.

$args

(stdClass)An object containing wp_nav_menu() arguments.


Top ↑

Source

File: wp-includes/nav-menu-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.1.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.