Changeset 3427 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
- Timestamp:
- 06/18/2016 12:33:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
r3420 r3427 43 43 global $wpdb; 44 44 45 $reviews = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ratings WHERE object_type = 'plugin' AND object_slug = %s ORDER BY review_id DESC LIMIT 2", $plugin_slug ) ); 45 $reviews = $wpdb->get_results( $wpdb->prepare( " 46 SELECT posts.post_text AS post_content, topics.topic_title AS post_title, ratings.rating AS post_rating, ratings.user_id AS post_author 47 FROM ratings 48 INNER JOIN minibb_topics AS topics ON ( ratings.review_id = topics.topic_id ) 49 INNER JOIN minibb_posts AS posts ON ( ratings.review_id = posts.topic_id ) 50 WHERE 51 ratings.object_type = 'plugin' AND 52 ratings.object_slug = %s AND 53 posts.post_position = 1 54 ORDER BY ratings.review_id DESC LIMIT 2", $plugin_slug ) ); 46 55 wp_cache_set( "{$plugin_slug}_reviews", $reviews, 'wporg-plugins', HOUR_IN_SECONDS ); 47 56 }
Note: See TracChangeset
for help on using the changeset viewer.