Save an explicit server PHP draft ability
Native settings and registered providers first. For an intentional server PHP exception, use server-php intent and the revision/element from get-element-php. Source is protected, syntax checked and signed for this page or part. Saves only a draft, never executes over the editor. Empty PHP removes it.
What it does#
Native settings and registered providers first. For an intentional server PHP exception, use server-php intent and the revision/element from get-element-php. Source is protected, syntax checked and signed for this page or part. Saves only a draft, never executes over the editor. Empty PHP removes it.
Access and execution#
This WordPress Ability runs as the authenticated caller. Site AI access, relevant content permissions, and feature-specific code or design gates still apply. See Automation access for authentication and transport setup. Discover the ability through the installed WordPress Abilities interface rather than guessing a different REST path.
Input schema#
{
"type": "object",
"properties": {
"page_id": {
"type": "integer"
},
"part": {
"type": "string",
"pattern": "^[a-z0-9_-]+$"
},
"rev": {
"type": "string"
},
"element": {
"type": "integer",
"minimum": 1
},
"intent": {
"type": "string",
"enum": [
"server-php"
]
},
"php": {
"type": "string",
"maxLength": 16384
}
},
"required": [
"page_id",
"rev",
"element",
"intent",
"php"
],
"additionalProperties": false
}
Output schema#
{
"type": "object"
}
Integration behavior#
Required fields and additionalProperties restrictions are part of the contract. Preserve returned revision tokens as opaque values. If a write reports a conflict, fetch the current source and reconcile before retrying. Draft and publication are separate operations unless this ability explicitly publishes. A successful schema match does not bypass content validation.
Errors use WordPress error responses; inspect their code, message, and status rather than assuming every non-success is retryable. Do not include credentials in diagnostic logs.