Contents
On this page

Delete Review - Plugixa Recipe

DELETE /plugixa-recipe/v1/reviews/{id}

Delete a review permanently, with its helpful votes.

Needs the plugixa_recipe_delete capability, or WordPress’s delete_published_posts (Author and up). The Reviews app must be on.

Request

DELETE https://your-site.example/wp-json/plugixa-recipe/v1/reviews/41

Path parameters

Name Type Description
id integer The review’s id

Responses

200 OK. The review is deleted.

{
  "success": true,
  "message": "Review deleted.",
  "data": null
}

The recipe’s average rating and rating count are worked out again.

Errors

Status Code When
404 rest_error No review with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-recipe/v1/reviews/41" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/reviews/41');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/reviews/41', {
  method: 'DELETE',
  headers: {
    'Authorization': auth,
  },
});
const { success } = await response.json();

Quick Links

Share