Make WordPress Core

Ticket #30480: 30480.patch

File 30480.patch, 3.0 KB (added by herbmillerjr, 10 years ago)
  • wp-includes/general-template.php

     
    13941394        $limit = $r['limit'];
    13951395
    13961396        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";
    13981398                $key = md5( $query );
    13991399                $key = "wp_get_archives:$key:$last_changed";
    14001400                if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     
    14141414                        }
    14151415                }
    14161416        } 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";
    14181418                $key = md5( $query );
    14191419                $key = "wp_get_archives:$key:$last_changed";
    14201420                if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     
    14331433                        }
    14341434                }
    14351435        } 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";
    14371437                $key = md5( $query );
    14381438                $key = "wp_get_archives:$key:$last_changed";
    14391439                if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     
    14551455                }
    14561456        } elseif ( 'weekly' == $r['type'] ) {
    14571457                $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";
    14591459                $key = md5( $query );
    14601460                $key = "wp_get_archives:$key:$last_changed";
    14611461                if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
     
    31123112                $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
    31133113
    31143114        return $settings;
    3115 }
     3115}
     3116 No newline at end of file