Editor: Add a role button
to the Tags meta box tag cloud links.
For better accessibility, the tag cloud links in the Tags meta box should be reported to assistive technologies as buttons. They don't navigate to a new resource, instead they perform an action. Fixes #38318. git-svn-id: https://develop.svn.wordpress.org/trunk@38800 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
95feac1df5
commit
7ea0f51f01
@ -917,6 +917,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||
$tags_data[] = array(
|
||||
'id' => $tag_id,
|
||||
'url' => '#' != $tag->link ? $tag->link : '#',
|
||||
'role' => '#' != $tag->link ? '' : ' role="button"',
|
||||
'name' => $tag->name,
|
||||
'title' => $title,
|
||||
'slug' => $tag->slug,
|
||||
@ -940,7 +941,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||
// generate the output links array
|
||||
foreach ( $tags_data as $key => $tag_data ) {
|
||||
$class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );
|
||||
$a[] = "<a href='" . esc_url( $tag_data['url'] ) . "' class='" . esc_attr( $class ) . "' title='" . esc_attr( $tag_data['title'] ) . "' style='font-size: " . esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ) . ";'>" . esc_html( $tag_data['name'] ) . "</a>";
|
||||
$a[] = "<a href='" . esc_url( $tag_data['url'] ) . "'" . $tag_data['role'] . " class='" . esc_attr( $class ) . "' title='" . esc_attr( $tag_data['title'] ) . "' style='font-size: " . esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ) . ";'>" . esc_html( $tag_data['name'] ) . "</a>";
|
||||
}
|
||||
|
||||
switch ( $args['format'] ) {
|
||||
|
Loading…
Reference in New Issue
Block a user