Make WordPress Core

Changeset 36092


Ignore:
Timestamp:
12/26/2015 12:47:35 AM (9 years ago)
Author:
SergeyBiryukov
Message:

Remove redundant title attribute from wp_star_rating(). Hide the visible number of ratings from assistive technologies.

This data is redundant, as the same information is already conveyed by the text hidden with .screen-reader-text class.

Props afercia.
Fixes #35141.

Location:
trunk/src/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r35953 r36092  
    527527                <div class="vers column-rating">
    528528                    <?php wp_star_rating( array( 'rating' => $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?>
    529                     <span class="num-ratings">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
     529                    <span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
    530530                </div>
    531531                <div class="column-updated">
  • trunk/src/wp-admin/includes/plugin-install.php

    r35958 r36092  
    573573        <h3><?php _e( 'Average Rating' ); ?></h3>
    574574        <?php wp_star_rating( array( 'rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings ) ); ?>
    575         <small><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></small>
     575        <small aria-hidden="true"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></small>
    576576        <?php }
    577577
  • trunk/src/wp-admin/includes/template.php

    r35903 r36092  
    99 */
    1010
    11 /** Walker_Category_Checklist class */ 
     11/** Walker_Category_Checklist class */
    1212require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' );
    1313
    14 /** WP_Internal_Pointers class */ 
     14/** WP_Internal_Pointers class */
    1515require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' );
    1616
     
    20552055    }
    20562056
    2057     $output = '<div class="star-rating" title="' . esc_attr( $title ) . '">';
     2057    $output = '<div class="star-rating">';
    20582058    $output .= '<span class="screen-reader-text">' . $title . '</span>';
    20592059    $output .= str_repeat( '<div class="star star-full"></div>', $full_stars );
  • trunk/src/wp-admin/theme-install.php

    r35977 r36092  
    260260                        <div class="theme-rating">
    261261                            {{{ data.stars }}}
    262                             <span class="num-ratings">({{ data.num_ratings }})</span>
     262                            <span class="num-ratings" aria-hidden="true">({{ data.num_ratings }})</span>
    263263                        </div>
    264264                    <# } else { #>
Note: See TracChangeset for help on using the changeset viewer.