bricks_regenerate_assets
Overview
Regenerates all Bricks CSS asset files. This is essential after any design system changes including color palette updates, global class modifications, variable changes, theme style updates, or custom CSS additions. Without regeneration, frontend rendering may not reflect the latest changes.
You can scope the regeneration to specific areas (pages, theme_styles, global_classes, colors, variables, custom_css) or regenerate everything at once with scope « all ».
Key Features
When to Use
After creating, updating, or deleting global classes
After modifying global CSS variables
After changing theme styles (typography, element defaults)
After adding or modifying custom CSS
After updating site settings that affect CSS output
When NOT to Use
Immediately after each individual change in a batch — wait until the batch is complete, then regenerate once
Parameters
scopestringoptionalall Values: all, pages, theme_styles, global_classes, colors, variables, custom_cssCode 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
Full Asset Regeneration
Regenerates all CSS files. Recommended after completing a batch of design system changes.
bricks_regenerate_assets({ scope: "all" })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
Regenerate Only Classes
Faster targeted regeneration after only modifying global classes.
bricks_regenerate_assets({ scope: "global_classes" })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
Tips & Warnings
Batch efficiency: When making multiple design system changes (Phase 2), perform all changes first, then call bricks_regenerate_assets once with scope « all » at the end. This is much faster than regenerating after each change.
CSS loading mode: Regeneration is especially important when cssLoading is set to « file » mode, as physical CSS files need to be rebuilt on disk.