mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
Accessibility: Themes: use aria-current
for the Walker_Page
current link.
See [42808] for `Walker_Nav_Menu`. The `aria-current` attribute is a simple, effective way to help assistive technologies users orientate themselves within a list of items. Continues the introduction in core of `aria-current` after [42440], [41683], [41359], and [41371]. Props chetan200891, wpzinc. Fixes #43522. Built from https://develop.svn.wordpress.org/trunk@44416 git-svn-id: http://core.svn.wordpress.org/trunk@44246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
49452cd73d
commit
efc9cbd553
@ -158,8 +158,9 @@ class Walker_Page extends Walker {
|
||||
$args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];
|
||||
$args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after'];
|
||||
|
||||
$atts = array();
|
||||
$atts['href'] = get_permalink( $page->ID );
|
||||
$atts = array();
|
||||
$atts['href'] = get_permalink( $page->ID );
|
||||
$atts['aria-current'] = ( $page->ID == $current_page ) ? 'page' : '';
|
||||
|
||||
/**
|
||||
* Filters the HTML attributes applied to a page menu item's anchor element.
|
||||
@ -169,7 +170,8 @@ class Walker_Page extends Walker {
|
||||
* @param array $atts {
|
||||
* The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
|
||||
*
|
||||
* @type string $href The href attribute.
|
||||
* @type string $href The href attribute.
|
||||
* @type string $aria_current The aria-current attribute.
|
||||
* }
|
||||
* @param WP_Post $page Page data object.
|
||||
* @param int $depth Depth of page, used for padding.
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.1-alpha-44415';
|
||||
$wp_version = '5.1-alpha-44416';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user