Opened 8 years ago
Closed 8 years ago
#43591 closed feature request (worksforme)
WordPress REST 2.0 - Media/Post orderby=order
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.9.4 |
| Component: | REST API | Keywords: | |
| Focuses: | rest-api | Cc: |
Description
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:
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
+881: 'order' => 'post_order',
+ 2163: 'order',
This would be useful for queries such as:
http://wpdistillery.vm/wp-json/wp/v2/media?parent=121&orderby=order
Thanks
Change History (2)
Note: See
TracTickets for help on using
tickets.
The
ordercolumn for attachments is already usable through the WP REST API, but it is mapped to the argumentmenu_order, notpost_order.So, this should already work as expected if you query against
menu_orderinstead ofpost_order.