Ticket #3961 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

wp_get_archives('type=postbypost') missing ORDER BY

Reported by: mattbta Assigned to: 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

3961.diff (0.7 kB) - added by foolswisdom on 03/12/07 21:42:48.

Change History

03/12/07 21:42:48 changed by foolswisdom

  • attachment 3961.diff added.

03/12/07 22:10:13 changed by westi

  • keywords set to commit.

+1

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

03/13/07 09:34:43 changed by westi

  • status changed from new to closed.
  • resolution set to duplicate.

Notes that this is a dupe of #3951

Closing as dupe of earlier ticket which also has-patch

03/13/07 16:48:12 changed by foolswisdom

  • milestone deleted.

03/14/07 02:21:41 changed by ryan

  • resolution changed from duplicate to fixed.

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

03/14/07 02:22:00 changed by ryan

  • milestone set to 2.2.