WordPress.org

Make WordPress Core

Ticket #2352: 2352.diff

File 2352.diff, 1.4 KB (added by westi, 8 years ago)

This one really doesn't use $now

  • wp-includes/general-template.php

     
    332332                                echo get_archives_link($url, $text, $format, $before, $after); 
    333333                        } 
    334334                } 
     335        } elseif ('yearly' == $type) { 
     336         $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts WHERE post_type ='post' AND post_status = 'publish' GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); 
     337                if ($arcresults) { 
     338            $afterafter = $after; 
     339            foreach ($arcresults as $arcresult) { 
     340                            $url = get_year_link($arcresult->year); 
     341                                if ($show_post_count) { 
     342                    $text = sprintf('%d', $arcresult->year); 
     343                    $after = ' ('.$arcresult->posts.')' . $afterafter; 
     344                } else { 
     345                    $text = sprintf('%d', $arcresult->year); 
     346                } 
     347                echo get_archives_link($url, $text, $format, $before, $after); 
     348            } 
     349                }                        
    335350        } elseif ( 'daily' == $type ) { 
    336351                $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); 
    337352                if ( $arcresults ) {