Changeset 9486
- Timestamp:
- 02/11/2020 01:32:11 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r9473 r9486 64 64 */ 65 65 protected static function plugin_json_jd_schema( $plugin ) { 66 $rating = get_post_meta( $plugin->ID, 'rating', true ) ?: 0; 67 $ratings = get_post_meta( $plugin->ID, 'ratings', true ) ?: []; 66 if ( class_exists( '\WPORG_Ratings' ) ) { 67 $rating = \WPORG_Ratings::get_avg_rating( 'plugin', $plugin->post_name ) ?: 0; 68 $ratings = \WPORG_Ratings::get_rating_counts( 'plugin', $plugin->post_name ) ?: []; 69 } else { 70 $rating = get_post_meta( $plugin->ID, 'rating', true ) ?: 0; 71 $ratings = get_post_meta( $plugin->ID, 'ratings', true ) ?: []; 72 } 73 68 74 $num_ratings = array_sum( $ratings ); 69 75 $banners = self::get_plugin_banner( $plugin );
Note: See TracChangeset
for help on using the changeset viewer.