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.
Source
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |