mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Accessibility: List Tables: use aria-current for the views current link.
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 the `aria-current` attribute after [41359] and [41371]. Props joedolson, flixos90, afercia. Fixes #32399. git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -231,18 +231,23 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
protected function get_edit_link( $args, $label, $class = '' ) {
|
||||
$url = add_query_arg( $args, 'edit.php' );
|
||||
|
||||
$class_html = '';
|
||||
$class_html = $aria_current = '';
|
||||
if ( ! empty( $class ) ) {
|
||||
$class_html = sprintf(
|
||||
' class="%s"',
|
||||
esc_attr( $class )
|
||||
);
|
||||
|
||||
if ( 'current' === $class ) {
|
||||
$aria_current = ' aria-current="page"';
|
||||
}
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'<a href="%s"%s>%s</a>',
|
||||
'<a href="%s"%s%s>%s</a>',
|
||||
esc_url( $url ),
|
||||
$class_html,
|
||||
$aria_current,
|
||||
$label
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user