Fix start of week and SQL WEEK handling. props mdawaffe, fixes #10397.

git-svn-id: https://develop.svn.wordpress.org/trunk@14499 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-07 05:01:29 +00:00
parent ec9d233b8b
commit c100b80c20
3 changed files with 31 additions and 16 deletions

View File

@@ -1780,7 +1780,7 @@ class WP_Query {
}
if ( $q['w'] )
$where .= " AND WEEK($wpdb->posts.post_date, 1)='" . $q['w'] . "'";
$where .= ' AND ' . _wp_mysql_week( "`$wpdb->posts`.`post_date`" ) . " = '" . $q['w'] . "'";
if ( intval($q['comments_popup']) )
$q['p'] = absint($q['comments_popup']);