Accessibility: improve the Star Ratings hiding empty elements for assistive technologies.

Fixes #36725.

git-svn-id: https://develop.svn.wordpress.org/trunk@37330 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2016-04-30 14:32:40 +00:00
parent 7ad11aaad8
commit ee30b90714

View File

@ -2071,9 +2071,9 @@ function wp_star_rating( $args = array() ) {
$output = '<div class="star-rating">';
$output .= '<span class="screen-reader-text">' . $title . '</span>';
$output .= str_repeat( '<div class="star star-full"></div>', $full_stars );
$output .= str_repeat( '<div class="star star-half"></div>', $half_stars );
$output .= str_repeat( '<div class="star star-empty"></div>', $empty_stars );
$output .= str_repeat( '<div class="star star-full" aria-hidden="true"></div>', $full_stars );
$output .= str_repeat( '<div class="star star-half" aria-hidden="true"></div>', $half_stars );
$output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
$output .= '</div>';
if ( $r['echo'] ) {