Contents
Delete Custom Field - Plugixa FAQ
DELETE /plugixa-faq/v1/custom-fields/{id}
Delete a custom field definition and the values stored for it.
Administrators only: the user needs the plugixa_faq_settings capability or WordPress’s manage_options. Needs Plugixa FAQ Pro: the free build does not register this route, so it answers 404 there.
Note. The values stored on FAQs under this key are deleted too, unless another definition (a translation in another language) still uses the same key.
Request
DELETE https://your-site.example/wp-json/plugixa-faq/v1/custom-fields/5
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The field’s id |
Responses
200 OK.
{
"success": true,
"message": "Custom field deleted",
"data": null
}
| Field | Type | Meaning |
|---|---|---|
message |
string |
A human-readable confirmation, translated to the site language |
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
No field with that id. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-faq/v1/custom-fields/5" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-faq/v1/custom-fields/5');
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/plugixa-faq/v1/custom-fields/5', {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share