bricks_create_global_element
Overview
Creates a new Bricks global element. Global elements are reusable element trees that synchronize across all instances — editing the global element definition updates every placement site-wide. This makes them ideal for content that must remain identical everywhere.
Unlike Components (which have configurable properties per instance), global elements have no per-instance customization. Every instance renders exactly the same content. Use global elements for consistent CTAs, banners, notices, navigation widgets, or any content block that should always match.
Key Features
When to Use
For shared navigation widgets or footer content blocks
For newsletter signup forms that appear on multiple pages
When content must stay synchronized — editing once updates everywhere
Understand the difference between global elements (sync everywhere) and components (configurable per instance)
When NOT to Use
When you need per-instance customization through properties
For cards, feature boxes, or testimonials that vary per instance
Parameters
Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
labelstringREQUIREDWarning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
elementsobjectREQUIREDWarning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
categorystringoptionalCode Examples
Create a CTA banner global element
Creates a reusable CTA banner that will be identical on every page where it is inserted.
bricks_create_global_element({
label: "CTA Banner",
category: "cta",
elements: {
type: "div",
ref: "cta-wrapper",
settings: {
"_display": "flex",
"_direction": "row",
"_justifyContent": "space-between",
"_alignItems": "center",
"_padding": { "top": "24", "right": "32", "bottom": "24", "left": "32" },
"_background": { "color": { "raw": "var(--bricks-color-primary)" } },
"_border": { "radius": { "top": "12", "right": "12", "bottom": "12", "left": "12" } }
},
children: [
{ type: "heading", settings: { "tag": "h3", "text": "Ready to get started?" }, globalClasses: ["heading-card"] },
{ type: "button", settings: { "text": "Contact Us", "link": { "url": "/contact" } }, globalClasses: ["btn-primary"] }
]
}
}){
"success": true,
"data": { "id": "ge_xyz789", "label": "CTA Banner", "element_count": 3 }
}
// Then insert on a page:
bricks_insert_global_element({
page_id: 33,
global_element_id: "ge_xyz789",
parent_id: "section-container-id"
})Common Mistakes
// Creating a global element for cards with different content
bricks_create_global_element({ label: "Service Card", ... })
// All instances will show the same title and description!// Use a component with properties for per-instance content
bricks_create_component({
label: "Service Card",
properties: [
{ label: "Title", connections: { "card-title": ["text"] } },
{ label: "Description", connections: { "card-desc": ["text"] } }
],
...
})Tips & Warnings
Global vs Component: Global elements sync everywhere (identical content). Components have configurable properties per instance (different content). Choose based on whether instances need to vary.
Placement: After creating a global element, use bricks_insert_global_element to place it on specific pages. You can also use bricks_update_global_element to modify it later — changes propagate to all instances.