Accessibility: improve the Star Ratings hiding empty elements for assistive technologies.
Fixes #36725. Built from https://develop.svn.wordpress.org/trunk@37330 git-svn-id: http://core.svn.wordpress.org/trunk@37296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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'] ) {
|
||||
|
||||
Reference in New Issue
Block a user