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
This commit is contained in:
@@ -25,7 +25,9 @@
|
|||||||
* @return string Nav menu item start element.
|
* @return string Nav menu item start element.
|
||||||
*/
|
*/
|
||||||
function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {
|
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.
|
// Add toggle button.
|
||||||
$output .= '<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)">';
|
$output .= '<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)">';
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.6-alpha-58292';
|
$wp_version = '6.6-alpha-58293';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|||||||
Reference in New Issue
Block a user