Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#26128 closed defect (bug) (fixed)

Default orderby for get_posts() is, date.

Reported by: ounziw's profile ounziw Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.8 Priority: normal
Severity: trivial Version: 2.6
Component: Query Keywords: has-patch
Focuses: Cc:

Description

Default orderby for get_posts() is, date, not post_date

WP_Query::get_posts allows array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count').
http://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-includes/query.php#L2575

WP_Query::get_posts adds the prefix "post_",
http://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-includes/query.php#L2615

Attachments (1)

get_posts()__orderby_Default_is_date.patch (1.1 KB) - added by ounziw 12 years ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
12 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.8
  • Version changed from 3.7.1 to 2.6

Missed in [7880].

#2 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 26329:

In get_posts(), alter the doc block and default args to make orderby equal to date, not post_date.

Props ounziw.
Fixes #26128.

Note: See TracTickets for help on using tickets.