Contents
List Translations - Plugixa FAQ
GET /plugixa-faq/v1/multilingual/{entity}/{id}/translations
List the items that are translations of one FAQ, category or custom field.
Any signed-in user with the plugixa_faq_manage capability or WordPress’s edit_posts (Contributors and up, by default).
Request
GET https://your-site.example/wp-json/plugixa-faq/v1/multilingual/faqs/42/translations
Path parameters
| Name | Type | Description |
|---|---|---|
entity |
string |
faqs, categories or custom-fields |
id |
integer |
The item’s id |
Responses
200 OK.
{
"success": true,
"message": "",
"data": {
"item": {
"id": "42",
"language_code": "en",
"translation_group": "9b2f6c1e-4d1a-4c55-a0de-3f7f1b2c8e10"
},
"translations": [
{
"id": "42",
"language_code": "en"
},
{
"id": "58",
"language_code": "fr"
}
],
"languages": [
{
"code": "en",
"name": "English",
"native_name": "English",
"flag_url": "",
"is_default": true
},
{
"code": "fr",
"name": "Français",
"native_name": "Français",
"flag_url": "",
"is_default": false
}
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.item |
object |
The requested item’s id, language and group |
data.translations |
array |
Every item in the group, this one included, by language code. Empty when the item has no group |
data.languages |
array |
Same as List Languages |
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_error |
“Invalid entity type.” |
404 |
rest_error |
No item with that id. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-faq/v1/multilingual/faqs/42/translations" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-faq/v1/multilingual/faqs/42/translations');
curl_setopt_array($ch, [
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/multilingual/faqs/42/translations', {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share