Contents
On this page
Delete Several FAQs - Plugixa FAQ
DELETE /plugixa-faq/v1/faqs/bulk
Delete several FAQs in one request.
Any signed-in user with the plugixa_faq_delete capability or WordPress’s edit_posts (Contributors and up, by default).
Note. As with Delete FAQ, children of a deleted FAQ move to the top level, and ids that match nothing are skipped without an error.
Request
DELETE https://your-site.example/wp-json/plugixa-faq/v1/faqs/bulk
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
ids |
integer[] |
Yes | The FAQs to delete. |
{
"ids": [
42,
43,
51
]
}
Responses
200 OK. data.deleted is how many FAQs went.
{
"success": true,
"message": "3 FAQs deleted successfully",
"data": {
"deleted": 3
}
}
| Field | Type | Meaning |
|---|---|---|
data.deleted |
integer |
Rows actually deleted |
message |
string |
A human-readable confirmation, translated to the site language |
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_error |
“No IDs provided”: ids is missing, empty or not a list. |
500 |
rest_error |
The database refused the delete. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-faq/v1/faqs/bulk" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"ids":[42,43,51]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-faq/v1/faqs/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' => [42, 43, 51],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-faq/v1/faqs/bulk', {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({ ids: [42, 43, 51] }),
});
const { data } = await response.json();
Quick Links
Share