Ticket #22599: 22599.diff
File 22599.diff, 2.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/plugin-install.php
311 311 function install_plugin_information() { 312 312 global $tab; 313 313 314 $api = plugins_api( 'plugin_information', array( 'slug' => wp_unslash( $_REQUEST['plugin'] ), 'is_ssl' => is_ssl() ) );314 $api = plugins_api( 'plugin_information', array( 'slug' => wp_unslash( $_REQUEST['plugin'] ), 'is_ssl' => is_ssl(), 'fields' => array( 'reviews' => true ) ) ); 315 315 316 316 if ( is_wp_error( $api ) ) 317 317 wp_die( $api ); … … 331 331 'faq' => _x('FAQ', 'Plugin installer section title'), 332 332 'screenshots' => _x('Screenshots', 'Plugin installer section title'), 333 333 'changelog' => _x('Changelog', 'Plugin installer section title'), 334 'reviews' => _x('Reviews', 'Plugin installer section title'), 334 335 'other_notes' => _x('Other Notes', 'Plugin installer section title') 335 336 ); 336 337 … … 401 402 <?php wp_star_rating( array( 'rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings ) ); ?> 402 403 <small><?php printf( _n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings) ); ?></small> 403 404 <?php endif; ?> 405 406 <?php 407 if ( ! empty( $api->ratings ) ) { 408 foreach( $api->ratings as $key=>$ratecount ) { 409 // avoid div-by-zero 410 $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0; 411 ?> 412 <div class="counter-container"> 413 <a href="//wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>" 414 title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key ), $key ) ); ?>"> 415 <span class="counter-label" style="float:left; margin-right:5px;"><?php echo $key; ?> stars</span> 416 <span class="counter-back" style="height:17px;width:92px;background-color:#ececec;float:left;"> 417 <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;height:17px;background-color:#fddb5a;float:left;"></span> 418 </span> 419 </a> 420 <span class="counter-count" style="margin-left:5px;"><?php echo $ratecount; ?></span> 421 </div> 422 <?php 423 } 424 } 425 ?> 404 426 </div> 405 427 <div id="section-holder" class="wrap"> 406 428 <?php