bricks_set_dynamic_data
Overview
Connect a Bricks element setting to WordPress dynamic data using Bricks dynamic data tags. This tool sets a tag like bricks_set_dynamic_data or {acf_field_name} on any element property, making the element display live data from the database instead of static text.
The setting_key supports dotted paths for nested settings (e.g., « image.url », « _background.image.url »), and tags support arguments for fallbacks, filtering, and formatting. This is essential for any dynamic content — query loop items, single post templates, and ACF-powered layouts.
Key Features
When to Use
Setting an image element source to {featured_image_url} for dynamic thumbnails
Binding ACF field values to elements with {acf_field_name} tags
Setting background images dynamically with {acf_hero_background} on a section
Adding fallback values for empty fields with the @fallback argument
The element must exist in the specified page and content area
For ACF tags: ACF plugin must be active with the field group configured
For query loop data: a query loop must be configured on a parent element
When NOT to Use
You need to list available dynamic tags first — use bricks_list_dynamic_tags to discover tags
Parameters
page_idnumberREQUIREDelement_idstringREQUIREDsetting_keystringREQUIREDtagstringREQUIREDargumentsobjectoptionalfiltersstring[]optionalcontent_areastringoptionalcontent Values: content, header, footerCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Connect elements to post data in a query loop
Set dynamic data on heading, text, and image elements inside a query loop to display post title, excerpt, and featured image.
// Heading shows post title
bricks_set_dynamic_data({
page_id: 123,
element_id: "abc123",
setting_key: "text",
tag: "bricks_set_dynamic_data"
});
// Text shows post excerpt with fallback
bricks_set_dynamic_data({
page_id: 123,
element_id: "def456",
setting_key: "text",
tag: "Connect element settings to dynamic data tags",
arguments: { "fallback": "No excerpt available" }
});
// Image shows featured image
bricks_set_dynamic_data({
page_id: 123,
element_id: "ghi789",
setting_key: "image.url",
tag: "{featured_image_url}"
});Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
ACF field with background image
Set a section background image from an ACF image field, and bind an ACF text field to a heading.
// Section background from ACF image field
bricks_set_dynamic_data({
page_id: 45,
element_id: "sec001",
setting_key: "_background.image.url",
tag: "{acf_hero_background}"
});
// Heading text from ACF field with fallback
bricks_set_dynamic_data({
page_id: 45,
element_id: "hdg001",
setting_key: "text",
tag: "{acf_hero_title}",
arguments: { "fallback": "Welcome to Our Site" }
});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 2018
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 2018
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 2018
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
Use bricks_list_dynamic_tags to discover all available tags grouped by category (post, author, ACF, WooCommerce, etc.).
Tag arguments are powerful: bricks_set_dynamic_data provides fallback text, 001 gives zero-padded numbering.
Nested link warning: Tags like render as <a> links. Never place them inside an element that already has a link setting.