Index: src/wp-admin/css/themes.css =================================================================== --- src/wp-admin/css/themes.css (revision 34673) +++ src/wp-admin/css/themes.css (working copy) @@ -1154,57 +1154,23 @@ } } -.theme-details .star-rating { - margin: 15px 0 0; +.theme-details .theme-rating { + line-height: 23px; } -.theme-details .star-rating span:before { - color: #ffb900; - content: "\f154"; - display: inline-block; - -webkit-font-smoothing: antialiased; - font: normal 20px/1 dashicons; - vertical-align: top; +.theme-details .star-rating { + display: inline; } -/* Half stars */ -.star-rating.rating-10 span.one:before, -.star-rating.rating-30 span.two:before, -.star-rating.rating-50 span.three:before, -.star-rating.rating-70 span.four:before, -.star-rating.rating-90 span.five:before { - content: "\f459"; +.theme-details .num-ratings, +.theme-details .no-rating { + font-size: 11px; + color: #999; } -/* Full stars */ -.star-rating.rating-20 span.one:before, -.star-rating.rating-30 span.one:before, -.star-rating.rating-40 span.one:before, -.star-rating.rating-40 span.two:before, -.star-rating.rating-50 span.one:before, -.star-rating.rating-50 span.two:before, -.star-rating.rating-60 span.one:before, -.star-rating.rating-60 span.two:before, -.star-rating.rating-60 span.three:before, -.star-rating.rating-70 span.one:before, -.star-rating.rating-70 span.two:before, -.star-rating.rating-70 span.three:before, -.star-rating.rating-80 span.one:before, -.star-rating.rating-80 span.two:before, -.star-rating.rating-80 span.three:before, -.star-rating.rating-80 span.four:before, -.star-rating.rating-90 span.one:before, -.star-rating.rating-90 span.two:before, -.star-rating.rating-90 span.three:before, -.star-rating.rating-90 span.four:before, -.star-rating.rating-100 > span:before { - content: "\f155"; -} - -.theme-details .star-rating .ratings { +.theme-details .no-rating { display: block; line-height: 20px; - color: #999; } /*------------------------------------------------------------------------------ @@ -1628,7 +1594,7 @@ } .install-theme-info .theme-screenshot { - margin-top: 15px; + margin: 15px 0; width: 258px; border: 1px solid #ccc; } Index: src/wp-admin/includes/ajax-actions.php =================================================================== --- src/wp-admin/includes/ajax-actions.php (revision 34673) +++ src/wp-admin/includes/ajax-actions.php (working copy) @@ -2797,7 +2797,8 @@ $theme->author = wp_kses( $theme->author, $themes_allowedtags ); $theme->version = wp_kses( $theme->version, $themes_allowedtags ); $theme->description = wp_kses( $theme->description, $themes_allowedtags ); - $theme->num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) ); + $theme->stars = wp_star_rating( array( 'rating' => $theme->rating, 'type' => 'percent', 'number' => $theme->num_ratings, 'echo' => false ) ); + $theme->num_ratings = number_format_i18n( $theme->num_ratings ); $theme->preview_url = set_url_scheme( $theme->preview_url ); } Index: src/wp-admin/includes/template-functions.php =================================================================== --- src/wp-admin/includes/template-functions.php (revision 34673) +++ src/wp-admin/includes/template-functions.php (working copy) @@ -1949,6 +1949,8 @@ * number of ratings may also be displayed by passing the $number parameter. * * @since 3.8.0 + * @since 4.4.0 Introduced the `echo` parameter. + * * @param array $args { * Optional. Array of star ratings arguments. * @@ -1957,13 +1959,16 @@ * @type string $type Format that the $rating is in. Valid values are 'rating' (default), * or, 'percent'. Default 'rating'. * @type int $number The number of ratings that makes up this rating. Default 0. + * @type bool $echo Whether to echo the generated markup. False to return the markup instead + * of echoing it. Default true. * } */ function wp_star_rating( $args = array() ) { $defaults = array( 'rating' => 0, - 'type' => 'rating', + 'type' => 'rating', 'number' => 0, + 'echo' => true, ); $r = wp_parse_args( $args, $defaults ); @@ -1989,12 +1994,18 @@ $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) ); } - echo '
'; + $output = ' '; + + if ( $r['echo'] ) { + echo $output; + } + + return $output; } /** Index: src/wp-admin/theme-install.php =================================================================== --- src/wp-admin/theme-install.php (revision 34673) +++ src/wp-admin/theme-install.php (working copy) @@ -239,14 +239,12 @@