mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Prepare DB queries in more places. Props filosofo. see #6644
git-svn-id: https://develop.svn.wordpress.org/trunk@7645 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -205,7 +205,7 @@ if ( $page_links )
|
||||
|
||||
if ( 1 == count($posts) && is_singular() ) :
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
|
||||
$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
|
||||
if ( $comments ) :
|
||||
// Make sure comments, post, and post_author are cached
|
||||
update_comment_cache($comments);
|
||||
|
||||
Reference in New Issue
Block a user