Support » Plugin: JSON API » Removing a post
4 years ago
Is there a way to remove a post using JSON API?
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.
1. Request a nonce using the following URL:
2. Then use the nonce to delete the post by ID, in this case post with ID 153
Have a good one 🙂
Thank you, Freshcode.
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.