Make WordPress Core

Ticket #36612: 36612.2.diff

File 36612.2.diff, 1.3 KB (added by celloexpressions, 8 years ago)

Add a link to view theme ratings, loading the link from the .org API.

  • src/wp-admin/includes/theme.php

     
    715715                                        <# if ( data.stars && 0 != data.num_ratings ) { #>
    716716                                                <div class="theme-rating">
    717717                                                        {{{ data.stars }}}
    718                                                         <span class="num-ratings">
     718                                                        <a class="num-ratings" target="_blank" href="{{ data.reviews_url }}">
    719719                                                                <?php
    720720                                                                /* translators: %s: number of ratings */
    721                                                                 echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
     721                                                                echo sprintf( __( '(%s ratings <span class="screen-reader-text">link to view ratings opens in a new tab</span>)' ), '{{ data.num_ratings }}' );
    722722                                                                ?>
    723                                                         </span>
     723                                                        </a>
    724724                                                </div>
    725725                                        <# } #>
    726726
  • src/wp-includes/class-wp-customize-manager.php

     
    56185618                        // Arguments for all queries.
    56195619                        $wporg_args = array(
    56205620                                'per_page' => 100,
     5621                                'fields'   => array(
     5622                                        'reviews_url' => true, // Explicitly request the reviews URL to be linked from the customizer.
     5623                                ),
    56215624                        );
    56225625
    56235626                        $args = array_merge( $wporg_args, $args );