popups REST endpoint
Manage popup records, their publication status, settings schema, or public event statistics.
Endpoint#
Manage popup records, their publication status, settings schema, or public event statistics.
/wp-json/cantata-edit/v1/popups
Named regular-expression groups in this registered route are path parameters. Replace them with an actual matching value when constructing a request.
GET#
This operation uses a server permission callback. Browser clients need an authenticated WordPress session and REST nonce. The server checks the relevant caller capability and feature gates.
Permission expression in this release:
'methods' => 'GET', 'permission_callback' => static fn() => current_user_can( 'edit_pages' ),
Registered argument schema#
[]
An empty schema means the route did not declare arguments in its registration. It does not mean that the callback accepts arbitrary data or has no required body fields. Callback-level validation remains authoritative.
Implementation#
POST#
This operation uses a server permission callback. Browser clients need an authenticated WordPress session and REST nonce. The server checks the relevant caller capability and feature gates.
Permission function: cantata_edit_can_popups.
Registered argument schema#
{
"title": {
"type": "string",
"required": true
},
"template": {
"type": "integer"
},
"kind": {
"type": "string",
"enum": [
"modal",
"slide-in",
"bar-top",
"bar-bottom",
"full",
"side-left",
"side-right"
],
"default": "modal"
}
}
WordPress applies these registered field rules before the callback. Feature-specific validation can add further constraints.
Callback input keys#
kind, template, title. This literal-key inventory supplements the registered schema; nested objects and downstream validators can define additional structure.
Implementation#
- cantata_edit_popup_new_html
- cantata_edit_popup_out
- cantata_edit_template_clean
- cantata_edit_without_kses
Client handling#
Use HTTPS on production sites. Treat authentication failures, validation errors, missing records, and stale-revision conflicts as different outcomes. Read the returned WordPress error code and message. Before retrying a timed-out mutation, determine whether the first request succeeded. Prefer the documented higher-level editor or Ability workflow when an endpoint coordinates several metadata owners.