Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#43591 closed feature request (worksforme)

WordPress REST 2.0 - Media/Post orderby=order

Reported by: spiritofelric's profile spiritofelric Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: REST API Keywords:
Focuses: rest-api Cc:


Is it possible to update Media requests to orderby the order field in the post table? It looks like it's already indexed for this purpose.

Seems easy to do:
+881: 'order' => 'post_order',
+ 2163: 'order',

This would be useful for queries such as:


Change History (2)

This ticket was mentioned in Slack in #core-restapi by schlessera. View the logs.

6 years ago

#2 @schlessera
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

The order column for attachments is already usable through the WP REST API, but it is mapped to the argument menu_order, not post_order.

So, this should already work as expected if you query against menu_order instead of post_order.

Note: See TracTickets for help on using tickets.