bricks_update_page_assets
Update per-page assets in Bricks Builder: enqueue JS dependencies, add footer inline JS or raw HTML, and inject infrastructure CSS (font-face, variables, keyframes) into the head. Visual styling stays in native editor channels.
Instructions
Set structured per-page assets (JS deps via wp_enqueue_script, JS in wp_footer, infra CSS in wp_head). Auto-sets GSAP flag when js_deps includes "gsap". Requires Bricks API Bridge v2.3+. ⚠️ The css field lands in plugin-private _bab_page_assets (wp_head 9997, BEFORE element CSS) which is INVISIBLE/uneditable in the Bricks builder — reserve it for INFRA only (@font-face, :root{--vars}, @keyframes, critical CSS). Human-editable layout/responsive/visual CSS belongs in a native channel: element _cssCustom (bricks_patch_page), page customCss (bricks_update_page_settings), or global CSS/classes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_id": "<page_id>"
},
"name": "bricks_update_page_assets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | No | Inline JS to output in footer (no <script> tags, just code) | |
| css | No | INFRA CSS only (raw rules, no <style> tags): @font-face, :root{--vars}, @keyframes, critical above-fold. NOT editable in the Bricks builder — do NOT put layout/responsive/visual CSS here; use element _cssCustom or page customCss instead. Editable CSS triggers a warning (or a hard block when BRICKS_MCP_BLOCK_EDITABLE_CSS=1). | |
| js_deps | No | JS dependencies to enqueue: "gsap", "scrolltrigger", "lenis" | |
| page_id | Yes | WordPress page/post ID | |
| raw_footer | No | Raw HTML for wp_footer (legacy catch-all, includes own tags) |