Make WordPress Core

Changeset 38800


Ignore:
Timestamp:
10/16/2016 08:08:01 PM (8 years ago)
Author:
afercia
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r38777 r38800  
    918918            'id'         => $tag_id,
    919919            'url'        => '#' != $tag->link ? $tag->link : '#',
     920            'role'       => '#' != $tag->link ? '' : ' role="button"',
    920921            'name'       => $tag->name,
    921922            'title'      => $title,
     
    941942    foreach ( $tags_data as $key => $tag_data ) {
    942943        $class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );
    943         $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>";
     944        $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>";
    944945    }
    945946
Note: See TracChangeset for help on using the changeset viewer.