Make WordPress Core

Changeset 58293


Ignore:
Timestamp:
06/03/2024 12:49:36 PM (6 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/inc/menu-functions.php

    r55276 r58293  
    2626 */
    2727function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {
    28     if ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) {
     28    if ( 'primary' === $args->theme_location
     29        && 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true )
     30    ) {
    2931
    3032        // Add toggle button.
Note: See TracChangeset for help on using the changeset viewer.