AJAX Endpoint
The plugin saves post order via a single WordPress AJAX action. This page documents the endpoint for developers building custom integrations.
Action: idpo_save_order
Saves the new order for a set of posts by updating each post’s menu_order field.
Request
- URL:
admin-ajax.php - Method: POST
- Capability required:
edit_posts
Parameters
| Parameter | Type | Description |
|---|---|---|
action |
string | Must be idpo_save_order |
nonce |
string | Nonce generated with the action idpo_save_order |
order |
int[] | Array of post IDs in the desired order |
paged |
int | Current page number (default: 1) |
perPage |
int | Posts per page (default: 20) |
How Offsets Work
The menu_order value for each post is calculated as:
menu_order = ((paged - 1) * perPage) + index
This ensures that items on page 2 start numbering from where page 1 left off. For example, with 20 posts per page, the first item on page 2 gets menu_order = 20.
Response
Returns a standard WordPress JSON response:
- Success:
{"success": true} - Error:
{"success": false, "data": {"message": "..."}}
