From 159068b2a089c1b5decec71a715144a38455b365 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 25 Nov 2019 10:23:03 +0000 Subject: [PATCH] Accessibility: Add an `aria-current` attribute to the Media Library switch links. The `aria-current` attribute is a simple, effective, way to help assistive technology users orientate themselves within a set of items. Props mayanksonawat, afercia. Merges [46746] to the 5.3 branch. Fixes #48271. Built from https://develop.svn.wordpress.org/branches/5.3@46777 git-svn-id: http://core.svn.wordpress.org/branches/5.3@46577 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 9 ++++++--- wp-includes/media-template.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index cf0c05c2ab..47194a5b7e 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -631,12 +631,15 @@ class WP_List_Table {
modes as $mode => $title ) { - $classes = array( 'view-' . $mode ); + $classes = array( 'view-' . $mode ); + $aria_current = ''; + if ( $current_mode === $mode ) { - $classes[] = 'current'; + $classes[] = 'current'; + $aria_current = ' aria-current="page"'; } printf( - "%s\n", + "%s\n", esc_url( add_query_arg( 'mode', $mode ) ), implode( ' ', $classes ), $title diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 978772d732..9c86bb47ca 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -318,7 +318,7 @@ function wp_print_media_templates() { - + diff --git a/wp-includes/version.php b/wp-includes/version.php index f415187a2a..3cfa87e751 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3.1-alpha-46776'; +$wp_version = '5.3.1-alpha-46777'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.