You appear to be a bot. Output may be restricted
Description
Filters the arguments for a single nav menu item.
Usage
$stdClass = twenty_twenty_one_add_menu_description_args( $args, $item, $depth );
Parameters
- $args
- ( stdClass ) required – An object of wp_nav_menu() arguments.
- $item
- ( WP_Post ) required – Menu item data object.
- $depth
- ( int ) required – Depth of menu item. Used for padding.
Returns
stdClass
Source
File name: twentytwentyone/inc/menu-functions.php
Lines:
1 to 13 of 13
function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) { if ( '</span>' !== $args->link_after ) { $args->link_after = ''; } if ( 0 === $depth && isset( $item->description ) && $item->description ) { // The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover. $args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>'; } return $args; }