Contents
On this page

Unlink Translation - Plugixa Testimonial

DELETE /plugixatestimonial/v1/multilingual/{entity}/{id}/translations/{lang}

Take an item out of its translation group. Nothing is deleted: the item gets a group of its own.

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

Note. The {lang} segment is required by the route but not used: the item named by {id} is the one unlinked, whatever language you put there. There is no existence check: an id that matches nothing still answers 200 with the success message, and nothing changes.

Request

DELETE https://your-site.example/wp-json/plugixatestimonial/v1/multilingual/testimonials/58/translations/fr

Path parameters

Name Type Description
entity string testimonials, categories or custom-fields
id integer The item to unlink
lang string 2 to 5 lower-case letters. Ignored

Responses

200 OK.

{
  "success": true,
  "message": "Translation unlinked.",
  "data": null
}
Field Type Meaning
message string A human-readable confirmation, translated to the site language

Errors

Status Code When
400 rest_error “Invalid entity type.”

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixatestimonial/v1/multilingual/testimonials/58/translations/fr" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/multilingual/testimonials/58/translations/fr');
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 response = await fetch('https://your-site.example/wp-json/plugixatestimonial/v1/multilingual/testimonials/58/translations/fr', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share