Contents
Set Default View - Plugixa Testimonial
POST /plugixatestimonial/v1/views/{id}/set-default
Make a view the default: the design used by any display that names no view.
Any signed-in user with the plugixa_testimonial_edit capability or WordPress’s edit_posts (Contributors and up, by default).
Note. The flag is cleared on every view before it is set on this one, without checking the id. An id that matches nothing answers
200and leaves the site with no default view.
Request
POST https://your-site.example/wp-json/plugixatestimonial/v1/views/2/set-default
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The view’s id |
Responses
200 OK.
{
"success": true,
"message": "Default view updated successfully",
"data": {
"id": 2
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The id you sent |
message |
string |
A human-readable confirmation, translated to the site language |
Errors
| Status | Code | When |
|---|---|---|
500 |
rest_error |
The database refused the update. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixatestimonial/v1/views/2/set-default" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/views/2/set-default');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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/views/2/set-default', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share