diff --git a/src/wp-content/themes/twentytwentyone/inc/menu-functions.php b/src/wp-content/themes/twentytwentyone/inc/menu-functions.php index 0299c58c41..c461047c77 100644 --- a/src/wp-content/themes/twentytwentyone/inc/menu-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/menu-functions.php @@ -87,11 +87,15 @@ add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons * @return stdClass */ function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) { - $args->link_after = ''; + if ( '' !== $args->link_after ) { + $args->link_after = ''; + } + if ( 0 === $depth && isset( $item->description ) && $item->description ) { // The extra element is here for styling purposes: Allows the description to not be underlined on hover. $args->link_after = ''; } + return $args; } add_filter( 'nav_menu_item_args', 'twenty_twenty_one_add_menu_description_args', 10, 3 );