Ticket #30480: 30480.patch
File 30480.patch, 3.0 KB (added by , 10 years ago) |
---|
-
wp-includes/general-template.php
1394 1394 $limit = $r['limit']; 1395 1395 1396 1396 if ( 'monthly' == $r['type'] ) { 1397 $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";1397 $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order, `ID` $order $limit"; 1398 1398 $key = md5( $query ); 1399 1399 $key = "wp_get_archives:$key:$last_changed"; 1400 1400 if ( ! $results = wp_cache_get( $key, 'posts' ) ) { … … 1414 1414 } 1415 1415 } 1416 1416 } elseif ( 'yearly' == $r['type'] ) { 1417 $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";1417 $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order, `ID` $order $limit"; 1418 1418 $key = md5( $query ); 1419 1419 $key = "wp_get_archives:$key:$last_changed"; 1420 1420 if ( ! $results = wp_cache_get( $key, 'posts' ) ) { … … 1433 1433 } 1434 1434 } 1435 1435 } elseif ( 'daily' == $r['type'] ) { 1436 $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";1436 $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order, `ID` $order $limit"; 1437 1437 $key = md5( $query ); 1438 1438 $key = "wp_get_archives:$key:$last_changed"; 1439 1439 if ( ! $results = wp_cache_get( $key, 'posts' ) ) { … … 1455 1455 } 1456 1456 } elseif ( 'weekly' == $r['type'] ) { 1457 1457 $week = _wp_mysql_week( '`post_date`' ); 1458 $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` $order $limit";1458 $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` $order, `ID` $order $limit"; 1459 1459 $key = md5( $query ); 1460 1460 $key = "wp_get_archives:$key:$last_changed"; 1461 1461 if ( ! $results = wp_cache_get( $key, 'posts' ) ) { … … 3112 3112 $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' ); 3113 3113 3114 3114 return $settings; 3115 } 3115 } 3116 No newline at end of file