bricks_update_page_assets
Assigns per-page CSS and JS assets to Bricks Builder pages, enqueuing dependencies and injecting inline scripts and infrastructure CSS.
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.
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) |