Contents
On this page

Delete Several Shortcodes - Plugixa Testimonial

DELETE /plugixatestimonial/v1/shortcodes/bulk

Delete several saved shortcodes for good in one request.

Any signed-in user with the plugixa_testimonial_delete capability or WordPress’s delete_others_posts (Editors and Administrators, by default).

Request

DELETE https://your-site.example/wp-json/plugixatestimonial/v1/shortcodes/bulk

Request body

Content type: application/json

Field Type Required Description
ids integer[] Yes Shortcode ids. Ids that match nothing are ignored.
{
  "ids": [
    7,
    8
  ]
}

Responses

200 OK.

{
  "success": true,
  "message": "2 shortcodes deleted successfully",
  "data": {
    "deleted": 2
  }
}
Field Type Meaning
data.deleted integer Shortcodes actually deleted
message string A human-readable confirmation, translated to the site language

Errors

Status Code When
400 rest_error “No IDs provided”

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixatestimonial/v1/shortcodes/bulk" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"ids":[7,8]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/shortcodes/bulk');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'ids' => [7, 8],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixatestimonial/v1/shortcodes/bulk', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: [7, 8] }),
});
const { data } = await response.json();

Quick Links

Share