A plugin to publish blogs to your WordPress website.
/delete-post
The /delete-post
endpoint is used to delete a specific post. You can choose to either move the post to the trash or delete it permanently.
/wp-json/sm-connect/v1/delete-post
DELETE
application/json
To delete a post, make a DELETE
request with the required parameters included in the query string. You must also include an Authorization
header with a valid Bearer token.
Header | Value |
---|---|
Authorization | Bearer <your_access_token> |
Parameter | Type | Description |
---|---|---|
id | int | The ID of the post to be deleted. |
trash | bool | Set to true to permanently delete the post, or omit to move it to trash. |
$http({
method: 'DELETE',
url: 'SITE_URL/wp-json/sm-connect/v1/delete-post',
headers: {
'Authorization': 'Bearer <your_access_token>',
'Content-Type': 'application/json'
},
params: {
id: 97,
trash: true
}
}).then(function successCallback(response) {
console.log('Post deleted:', response.data.message);
}, function errorCallback(response) {
console.error('Error:', response.data.message);
});