From fe3ad933038dbc8ebd65dcce5827ee8dd491fc05 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 3 Jun 2024 12:51:12 +0000 Subject: [PATCH] Twenty Twenty-One: Only add the sub-menu toggle button to the primary menu. Follow-up to [49216]. Props domainsupport, mukesh27, poena, karmatosed, shailu25, SergeyBiryukov. Fixes #52694. Built from https://develop.svn.wordpress.org/trunk@58293 git-svn-id: http://core.svn.wordpress.org/trunk@57753 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwentyone/inc/menu-functions.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/twentytwentyone/inc/menu-functions.php b/wp-content/themes/twentytwentyone/inc/menu-functions.php index d8d2aae36c..5c14b96a35 100644 --- a/wp-content/themes/twentytwentyone/inc/menu-functions.php +++ b/wp-content/themes/twentytwentyone/inc/menu-functions.php @@ -25,7 +25,9 @@ * @return string Nav menu item start element. */ function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) { - if ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) { + if ( 'primary' === $args->theme_location + && 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) + ) { // Add toggle button. $output .= '