Contents
Get Default Address - Plugixa Permalink Manager
GET /plugixa-permalink-manager/v1/uris/{kind}/{id}/default
Read the address the item’s pattern would give it right now. Nothing is saved.
Needs the plugixa_permalink_manager_view capability.
The answer is not checked for uniqueness: when another item already holds it, saving it with Update Address and reset: true adds a number.
Request
GET https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36/default
Path parameters
| Name | Type | Description |
|---|---|---|
kind |
string |
post or term |
id |
integer |
The post or term id |
Responses
200 OK.
{
"success": true,
"data": {
"uri": "shop/tents/skyline-2"
}
}
| Field | Type | Meaning |
|---|---|---|
data.uri |
string |
The default address, without outer slashes |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_permalink_manager_not_found |
No post or term with that id. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36/default" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36/default');
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 auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36/default', {
headers: { 'Authorization': auth },
});
const { data } = await response.json();
Quick Links
Share