bricks_patch_page
Apply partial updates to a Bricks Builder page by sending only changed elements, with automatic backup and optimistic locking to prevent overwriting concurrent edits.
Instructions
Apply partial updates to a page. Only sends changed elements instead of full page data. More efficient than bricks_update_page for small changes. Automatically creates a backup before writing (plugin-side, cannot be skipped). Supports optimistic locking via content_hash. Use content_area to patch header or footer. THEME-FIRST: when adding or restyling elements, reuse existing theme tokens and global classes (bricks_get_theme_styles / bricks_list_global_classes) instead of inline styling; prefer settings.style and _typography over _cssCustom, and the text-link/button elements over styled divs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | New elements to add | |
| remove | No | Element IDs to remove | |
| update | No | Elements to update (must include id, only changed settings needed) | |
| page_id | Yes | Page ID | |
| content_area | No | Which content area to patch (default: content). | content |
| content_hash | No | Content hash for optimistic locking, from bricks_get_page. Locking is per content_area: for header/footer use content_hashes.header / content_hashes.footer, NOT content_hash (that is the content area). If provided, the patch fails with 409 if that area changed since you read it. | |
| regenerate_css | No | Whether to regenerate CSS after patching (default: true) |