Changeset 7282 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 06/07/2018 04:32:31 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r7075 r7282 231 231 $post = get_post( $post ); 232 232 233 $rating = get_post_meta( $post->ID, 'rating', true ) ?: 0; 234 $ratings = get_post_meta( $post->ID, 'ratings', true ) ?: array(); 233 if ( class_exists( '\WPORG_Ratings' ) ) { 234 $rating = \WPORG_Ratings::get_avg_rating( 'plugin', $post->post_name ) ?: 0; 235 $ratings = \WPORG_Ratings::get_rating_counts( 'plugin', $post->post_name ) ?: array(); 236 } else { 237 $rating = get_post_meta( $post->ID, 'rating', true ) ?: 0; 238 $ratings = get_post_meta( $post->ID, 'ratings', true ) ?: array(); 239 } 240 235 241 $num_ratings = array_sum( $ratings ); 236 242
Note: See TracChangeset
for help on using the changeset viewer.