Hi,
I created a controller for deleting a post by ID. Save the PHP code from the following link as ‘postsextra.php’ in the plugins -> json-api -> controllers folder.
Link
http://pastebin.com/0mT3zSzp
Usage
1. Request a nonce using the following URL:
http://www.yourdomain.com/app/get_nonce/?controller=postsextra&method=delete_post
2. Then use the nonce to delete the post by ID, in this case post with ID 153
http://www.yourdomain.com/app/postsextra/delete_post/?nonce=c4dec48dbc&id=153
Have a good one 🙂
One question Freshcode. When I execute the command I get the following error.
“error”: “Unknown controller ‘postsextra’.”
Does this need to initialize?
You need to activate the controller in the plugin settings. WP Dashboard -> Settings -> JSON API -> activate the Posts Extra controller
OOPS! Thank you again, Freshcode. It now works fine.