apply_filters( ‘pre_wp_setup_nav_menu_item’, object|null $modified_menu_item, object $menu_item )

Filters whether to short-circuit the wp_setup_nav_menu_item() output.

Description

Returning a non-null value from the filter will short-circuit wp_setup_nav_menu_item() , returning that value instead.

Parameters

$modified_menu_itemobject|null
Modified menu item. Default null.
$menu_itemobject
The menu item to modify.

Source

$pre_menu_item = apply_filters( 'pre_wp_setup_nav_menu_item', null, $menu_item );

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.