WordPress.org

Making WordPress.org


Ignore:
Timestamp:
08/09/2016 08:20:56 PM (5 years ago)
Author:
obenland
Message:

Plugin Directory: Accessibility improvements.

Adds more context to ambiguous UI items on front page and single plugin page.

Fixes #1862.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php

    r3670 r3792  
    9191        $num_ratings = array_sum( $ratings );
    9292
    93         return '<div class="plugin-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">' .
    94                '<meta itemprop="ratingCount" content="' . esc_attr( $num_ratings ) . '"/>' .
    95                '<meta itemprop="ratingValue" content="' . esc_attr( $rating ) . '"/>' .
    96                Template::dashicons_stars( $rating ) .
    97                '<span class="rating-count">(' . esc_html( $num_ratings ) . ')</span>' .
    98                '</div>';
     93        return
     94            '<div class="plugin-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">' .
     95                '<meta itemprop="ratingCount" content="' . esc_attr( $num_ratings ) . '"/>' .
     96                '<meta itemprop="ratingValue" content="' . esc_attr( $rating ) . '"/>' .
     97                Template::dashicons_stars( $rating ) .
     98                /* translators: 1: number of ratings */
     99                '<span class="rating-count">(' . sprintf( __( '%1$s <span class="screen-reader-text">total ratings</span>' ), esc_html( $num_ratings ) ) . ')</span>' .
     100            '</div>';
    99101    }
    100102
     
    410412        $title          = sprintf( $title_template, $rating );
    411413
    412         $output  = '<div class="wporg-ratings" title="' . esc_attr( $title ) . '" data-title-template="' . esc_attr( $title_template ) . '" data-rating="' . esc_attr( $rating ) . '" style="color:#ffb900;">';
     414        $output  = '<div class="wporg-ratings" aria-label="' . esc_attr( $title ) . '" data-title-template="' . esc_attr( $title_template ) . '" data-rating="' . esc_attr( $rating ) . '" style="color:#ffb900;">';
    413415        $counter = round( $rating * 2 );
    414416        for ( $i = 1; $i <= 5; $i++ ) {
Note: See TracChangeset for help on using the changeset viewer.