WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#39657 closed defect (bug) (duplicate)

Posts endpoint doesn't support orderby=menu_order

Reported by: jordan314 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords:
Focuses: rest-api Cc:

Description

Using the WP API v2 in wordpress 4.7, you cannot query posts with orderby=menu_order which is what the plugin metronet-reorder-posts uses. The error returned is "orderby is not one of date, relevance, id, include, title, slug." This was previously possible in wordpress 4.6 with the wp-api plugin.

Change History (4)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to REST API

#2 @adamsilverstein
4 years ago

@jordan314 menu_order is not currently supported out of the box, you may want to comment on #38693 where we are discussing expanding what orderby options are supported by default.

In the meantime, can enable custom orderby parameters using the rest_post_collection_params filter, see https://core.trac.wordpress.org/ticket/38693#comment:5

#3 @adamsilverstein
4 years ago

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

Duplicate of #38693.

#4 @jordan314
4 years ago

That worked, thanks!

Note: See TracTickets for help on using tickets.