WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#34797 closed defect (bug) (invalid)

WP_Query orderby broken for menu_order when posts_per_page is set

Reported by: dan.rossiter Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

Passing the following arguments to WP_Query results in a seemingly arbitrary ordering. Definitely not the menu order.

[posts_per_page] => 16,
[offset] => 0,
[orderby] => menu_order,
[order] => ASC,
[post_status] => any,
[post_type] => attachment,
[post_mime_type] => application,video,text,audio,image,
[suppress_filters] => 1,
[post_parent] => null

Settings posts_per_page to -1 gets you the full list in the correct order.

This has been broken since at least 4.3.x.

Change History (1)

#1 @pento
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 4.3.1 deleted
Note: See TracTickets for help on using tickets.