Contents
On this page
Rendered Testimonials Page - Plugixa Testimonial
GET /plugixatestimonial/v1/frontend/testimonials/page
Read one page of approved testimonials already rendered to HTML, as the shortcode’s AJAX pagination does.
Public: no authentication. Only approved testimonials.
Note. The cards use the saved shortcode’s view, else the default view. Only the
grid,masonryandlistlayouts are rendered here: any other layout, such as a slider, comes back as grid cards. Pagination HTML is returned only for the numbered pagination style.
Request
GET https://your-site.example/wp-json/plugixatestimonial/v1/frontend/testimonials/page?shortcode_id=7&page=2&per_page=8
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
shortcode_id |
integer |
0 |
A saved shortcode whose categories, featured_only, min_rating, order and limit apply. 0 for all approved testimonials in manual order. |
page |
integer |
1 |
Page to return, from 1. |
per_page |
integer |
8 |
Rows per page, 1 to 100. |
With WPML or Polylang active, rows are those of the visitor’s current language, plus default-language rows that have no translation unless the multilingual fallback is set to hide them.
Responses
200 OK. data.items_html is the page of cards.
{
"success": true,
"message": "",
"data": {
"items_html": "<div class=\"pxt-custom-grid\">...</div>",
"pagination_html": "<nav class=\"pxt-pagination pxt-pagination-numbers ...\" aria-label=\"Testimonials pagination\">...</nav>",
"current_page": 2,
"total_pages": 3,
"total_items": 20
}
}
| Field | Type | Meaning |
|---|---|---|
data.items_html |
string |
The cards, empty when the page has none |
data.pagination_html |
string |
The page links, or empty |
data.current_page |
integer |
The page returned |
data.total_pages |
integer |
Pages at this per_page |
data.total_items |
integer |
Matching testimonials, capped at the shortcode’s limit |
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_invalid_param |
per_page above 100, or page below 1. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixatestimonial/v1/frontend/testimonials/page?shortcode_id=7&page=2&per_page=8"
<?php
$query = http_build_query([
'shortcode_id' => '7',
'page' => '2',
'per_page' => '8',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/frontend/testimonials/page?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ shortcode_id: '7', page: '2', per_page: '8' });
const response = await fetch(`https://your-site.example/wp-json/plugixatestimonial/v1/frontend/testimonials/page?${query}`);
const { data } = await response.json();
Quick Links
Share