bricks_create_popup
Overview
Creates a Bricks popup template with a trigger, display conditions, and appearance settings. Popups support six trigger types (load, scroll, exit_intent, click, timed, inactivity), frequency control (once, every_visit, always), AJAX lazy-loading for performance, and configurable position, animation, and overlay. This is the primary tool for building newsletter signups, exit-intent offers, cookie consent, and promotional popups.
Key Features
When to Use
When building exit-intent promotional offers
When adding cookie consent or GDPR notices
When creating announcement bars triggered by scroll or load delay
When building click-triggered modal dialogs (e.g., video lightbox, pricing details)
Content for the popup should be planned before creation
Display conditions should be decided (which pages show the popup)
When NOT to Use
When you want a sticky header/footer element — use bricks_create_template with type "header"/"footer"
When the popup should have no automatic trigger (click-only from a specific element) — create the popup first, then use bricks_create_popup_trigger
Parameters
titlestringREQUIREDcontentobjectoptionaltriggerobjectREQUIREDpopup_settingsobjectREQUIREDconditionsarrayoptionalstatusstringoptionalpublish Values: publish, draftCode Examples
Warning: Undefined array key "example_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 10
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Create an exit-intent newsletter popup
{
"tool": "bricks_create_popup",
"params": {
"title": "Newsletter Signup",
"trigger": {
"type": "exit_intent",
"repeat": "once",
"cookie_days": 30
},
"popup_settings": {
"width": "600px",
"height": "auto",
"position": "center",
"animation": "zoomIn",
"animation_out": "fadeOut",
"animation_duration": "0.3s",
"overlay_color": "rgba(0,0,0,0.6)",
"close_on_overlay_click": true,
"close_on_esc": true,
"show_close_button": true,
"disable_page_scroll": true
},
"conditions": [{ "main": "any" }],
"status": "publish"
}
}{
"popup_id": 42,
"title": "Newsletter Signup",
"trigger": { "type": "exit_intent", "repeat": "once", "cookie_days": 30 },
"conditions": [{ "main": "any", "id": "a1b2c3" }]
}Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
Mobile consideration: Exit intent triggers rely on mouse movement detection, which does not exist on mobile. For mobile visitors, consider using a scroll-based trigger (e.g., 50% page scroll) or a timed trigger (e.g., 30 seconds delay) as a fallback.
Performance: Set ajax_load: true for popups with heavy content (images, forms, videos). This loads the popup HTML only when triggered, not on initial page load.
Click triggers: To trigger a popup from a specific button, first create the popup without a trigger, then use bricks_create_popup_trigger to link a button element to the popup.