Make WordPress Core

Changeset 44975


Ignore:
Timestamp:
03/21/2019 10:01:42 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Customize: Add a link to theme reviews in the theme details modal in the Customizer and on Add Themes screen.

Props celloexpressions, Travel_girl, Ixium, marco-peralta, dd32.
Fixes #36612.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r44924 r44975  
    32673267                array(
    32683268                        'per_page' => 20,
    3269                         'fields'   => $theme_field_defaults,
     3269                        'fields'   => array_merge(
     3270                                (array) $theme_field_defaults,
     3271                                array(
     3272                                        'reviews_url' => true, // Explicitly request the reviews URL to be linked from the Add Themes screen.
     3273                                )
     3274                        ),
    32703275                )
    32713276        );
  • trunk/src/wp-admin/includes/theme.php

    r44973 r44975  
    722722                                                <div class="theme-rating">
    723723                                                        {{{ data.stars }}}
    724                                                         <span class="num-ratings">
     724                                                        <a class="num-ratings" target="_blank" href="{{ data.reviews_url }}">
    725725                                                                <?php
    726726                                                                /* translators: %s: number of ratings */
    727                                                                 echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
     727                                                                echo sprintf( __( '(%s ratings) <span class="screen-reader-text">link to view ratings opens in a new tab</span>' ), '{{ data.num_ratings }}' );
    728728                                                                ?>
    729                                                         </span>
     729                                                        </a>
    730730                                                </div>
    731731                                        <# } #>
  • trunk/src/wp-admin/theme-install.php

    r43571 r44975  
    336336                                                        <div class="theme-rating">
    337337                                                                {{{ data.stars }}}
    338                                                                 <span class="num-ratings">({{ data.num_ratings }})</span>
     338                                                                <a class="num-ratings" href="{{ data.reviews_url }}">
     339                                                                        <?php
     340                                                                        /* translators: %s: number of ratings */
     341                                                                        echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
     342                                                                        ?>
     343                                                                </a>
    339344                                                        </div>
    340345                                                <# } else { #>
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r44785 r44975  
    57305730                        $wporg_args = array(
    57315731                                'per_page' => 100,
     5732                                'fields'   => array(
     5733                                        'reviews_url' => true, // Explicitly request the reviews URL to be linked from the customizer.
     5734                                ),
    57325735                        );
    57335736
Note: See TracChangeset for help on using the changeset viewer.