Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#3961 closed defect (bug) (fixed)

wp_get_archives('type=postbypost') missing ORDER BY

Reported by: mattbta Owned by:
Milestone: 2.2 Priority: normal
Severity: major Version: 2.2
Component: Template Keywords: commit
Focuses: Cc:


wp-includes/general-template.php function wp_get_archives() line 417/418 :

('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
		$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where $orderby $limit");

Should be:

('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
		$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit");

Attachments (1)

3961.diff (718 bytes) - added by foolswisdom 8 years ago.

Download all attachments as: .zip

Change History (6)

@foolswisdom8 years ago

comment:1 @westi8 years ago

  • Keywords commit added


/me hides in shame for breaking it with his last patch

comment:2 @westi8 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Notes that this is a dupe of #3951

Closing as dupe of earlier ticket which also has-patch

comment:3 @foolswisdom8 years ago

  • Milestone 2.2 deleted

comment:4 @ryan8 years ago

  • Resolution changed from duplicate to fixed

(In [5036]) Fix order by in wp_get_archives(). Props mattbta. fixes #3961

comment:5 @ryan8 years ago

  • Milestone set to 2.2
Note: See TracTickets for help on using tickets.