Use Case
User says "add a paragraph after the heading" or "delete the second block" in the block editor chat. AI reads the current post blocks, performs the requested insert/replace/delete operation, validates the markup with parse_blocks(), and saves via REST API. Destructive operations (replace, delete) require confirmation.
Checklist
References
- Abilities Guide
- Existing destructive ability example:
includes/abilities/plugin-deactivate.php + src/extensions/abilities/plugin-deactivate.js
Notes
Operations: insert, replace, delete blocks by position. Reads current content from editor state or REST API (GET /wp/v2/posts/{id}). Saves via PUT /wp/v2/posts/{id} with content field. Validates all markup with parse_blocks() before saving — zero "Attempt Block Recovery" errors. Replace and delete operations are destructive and need requiresConfirmation: true. Depends on Goal 7 (block editor chat window) for the editor-side surface. See CLOUDFEST_HACKATHON.md Goal 8.
Use Case
User says "add a paragraph after the heading" or "delete the second block" in the block editor chat. AI reads the current post blocks, performs the requested insert/replace/delete operation, validates the markup with
parse_blocks(), and saves via REST API. Destructive operations (replace, delete) require confirmation.Checklist
includes/abilities/update-post-content.phpusingregister_agentic_ability()src/extensions/abilities/update-post-content.jswithregisterAbility()src/extensions/abilities/index.jstests/abilities/core-abilities.test.jsnpm run buildandnpm run test:abilitiesReferences
includes/abilities/plugin-deactivate.php+src/extensions/abilities/plugin-deactivate.jsNotes
Operations: insert, replace, delete blocks by position. Reads current content from editor state or REST API (
GET /wp/v2/posts/{id}). Saves viaPUT /wp/v2/posts/{id}withcontentfield. Validates all markup withparse_blocks()before saving — zero "Attempt Block Recovery" errors. Replace and delete operations are destructive and needrequiresConfirmation: true. Depends on Goal 7 (block editor chat window) for the editor-side surface. See CLOUDFEST_HACKATHON.md Goal 8.