From e317aba2774608eb321722262afebf36ae6ac0f3 Mon Sep 17 00:00:00 2001 From: joedolson Date: Mon, 3 Mar 2025 20:09:23 +0000 Subject: [PATCH] Bundled Themes: Twenty Twelve: Add ARIA attributes on menu toggle. Add `aria-expanded` and `aria-controls` attributes to the Twenty Twelve mobile menu toggle. Props bschneidewind, joedolson, sabernhardt, umeshsinghin. Fixes #62892. Built from https://develop.svn.wordpress.org/trunk@59911 git-svn-id: http://core.svn.wordpress.org/trunk@59253 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/js/navigation.js | 10 ++++++++++ wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentytwelve/js/navigation.js b/wp-content/themes/twentytwelve/js/navigation.js index f7141bff7e..93bc0d3f03 100644 --- a/wp-content/themes/twentytwelve/js/navigation.js +++ b/wp-content/themes/twentytwelve/js/navigation.js @@ -20,15 +20,25 @@ return; } + // Assign an ID for the default page list if no menu is set as Primary. + if ( ! menu.id ) { + menu.id = 'twentytwelve-page-list-menu'; + } + + button.setAttribute( 'aria-controls', menu.id ); + button.setAttribute( 'aria-expanded', 'false' ); + button.onclick = function() { if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className = 'nav-menu'; } if ( -1 !== button.className.indexOf( 'toggled-on' ) ) { + button.setAttribute( 'aria-expanded', 'false' ); button.className = button.className.replace( ' toggled-on', '' ); menu.className = menu.className.replace( ' toggled-on', '' ); } else { + button.setAttribute( 'aria-expanded', 'true' ); button.className += ' toggled-on'; menu.className += ' toggled-on'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index e0117016a5..257e29ecb4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59910'; +$wp_version = '6.8-alpha-59911'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.