Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#3961 closed defect (bug) (fixed)

wp_get_archives('type=postbypost') missing ORDER BY

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

Description

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 6 years ago.

Download all attachments as: .zip

Change History (6)

  • Keywords commit added

+1

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

  • 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

  • Milestone 2.2 deleted

comment:4   ryan6 years ago

  • Resolution changed from duplicate to fixed

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

comment:5   ryan6 years ago

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