Contents
On this page

List Permastructures - Plugixa Permalink Manager

GET /plugixa-permalink-manager/v1/permastructures

List every managed post type and taxonomy with its address pattern and the tags it can use.

Needs the plugixa_permalink_manager_view capability.

Request

GET https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures

Query parameters

Name Type Default Description
language string A language code on a multilingual site, to read or write that language’s own pattern. Empty for the pattern every language falls back to

Responses

200 OK. data is one entry per content type.

{
  "success": true,
  "data": [
    {
      "kind": "post_type",
      "name": "product",
      "label": "Products",
      "language": "",
      "pattern": "shop/%product_cat%/%postname%",
      "append_slug": true,
      "inherited": null,
      "native": "product/skyline-2",
      "tags": [
        {
          "tag": "postname",
          "label": "Post name (full path for pages)",
          "group": "post"
        },
        {
          "tag": "product_cat",
          "label": "Categories (full path)",
          "group": "taxonomy"
        }
      ]
    }
  ],
  "meta": {
    "languages": []
  }
}
Field Type Meaning
data[].kind string post_type or taxonomy
data[].name string The post type or taxonomy name
data[].label string Its plural label
data[].language string The language asked for, empty for the pattern every language falls back to
data[].pattern string|null The stored pattern, null when the type uses its WordPress structure (or, with a language, has no pattern of its own)
data[].append_slug boolean Whether the slug is added when the pattern has no slug tag
data[].inherited string|null With a language: the pattern it falls back to. null without one
data[].native string|null The WordPress address of one real item of the type, as an example
data[].tags array The tags this type can use: tag (without the % signs), label and group (post, date, taxonomy, term, …)
meta.languages array The site’s language codes, default first. Empty on a single-language site

See Permastructures and Tags for what the patterns and tags do.

Errors

Status Code When
422 plugixa_permalink_manager_invalid_language language is not one of the site’s languages.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures');
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/permastructures', {
  headers: { 'Authorization': auth },
});
const { data, meta } = await response.json();

Quick Links

Share