mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -965,8 +965,8 @@ function wp_get_archives($args = '') {
|
||||
}
|
||||
}
|
||||
} elseif ( 'weekly' == $type ) {
|
||||
$start_of_week = get_option('start_of_week');
|
||||
$query = "SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC $limit";
|
||||
$week = _wp_mysql_week( '`post_date`' );
|
||||
$query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` DESC $limit";
|
||||
$key = md5($query);
|
||||
$cache = wp_cache_get( 'wp_get_archives' , 'general');
|
||||
if ( !isset( $cache[ $key ] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user