Changeset 12333
- Timestamp:
- 12/07/2009 06:09:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-widgets.php
r12209 r12333 635 635 636 636 if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) { 637 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 15");637 $comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 15"); 638 638 wp_cache_add( 'recent_comments', $comments, 'widget' ); 639 639 }
Note: See TracChangeset
for help on using the changeset viewer.