10up / simple-page-ordering

Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
https://wordpress.org/plugins/simple-page-ordering/
GNU General Public License v2.0
149 stars 23 forks source link

Add REST API for reordering posts #67

Closed rmccue closed 2 years ago

rmccue commented 3 years ago

Is your enhancement related to a problem? Please describe.

I have a frontend application (React SPA) which I would like to add post reordering to, while controlling the frontend implementation.

Describe the solution you'd like

I'd like to reuse Simple Post Ordering's reordering logic (i.e. Simple_Page_Ordering::ajax_simple_page_ordering) to handle the reordering of the posts in the backend while handling the frontend implementation myself.

Designs

Describe alternatives you've considered

It could be possible to use the existing admin-ajax callback, however this requires accessing admin-ajax (i.e. the admin) which may not always be accessible in a browser context from the frontend. Additionally, the error information returned is very basic, and is not valid JSON.

Additional context

(Feel free to close this as a wontfix if this isn't something you're interested in tackling; I would completely understand :) )