Repository navigation
Extensions Style Binding
Added in 2.1.0
Maps CSS property names — including CSS custom properties — to a DSGo binding source and field key. Values are resolved server-side at render time and injected as inline styles on the block's root element.
Each block receives a dsgoStyleBinding attribute (type object, default {}). The attribute is a map of CSS property → { source, args: { key } }. A render_block filter reads the attribute, resolves each value through the named binding source, and appends the resulting declarations to the block's existing style attribute using WP_HTML_Tag_Processor.
Open any block's settings, scroll to Advanced, then find the Style Bindings panel.
- Click + Add style binding to create a new entry.
- Each entry has three fields:
-
CSS property — any valid CSS property name or custom property (e.g.
color,--brand-primary). - Source — one of: Post meta, ACF, Meta Box, Pods, JetEngine.
- Field key / name — the meta key or field name to read.
-
CSS property — any valid CSS property name or custom property (e.g.
- Remove an entry with its Remove button.
The panel opens automatically when at least one binding is already configured.
| Source slug | Available when |
|---|---|
designsetgo/post-meta |
Always |
designsetgo/acf |
ACF active |
designsetgo/metabox |
Meta Box active |
designsetgo/pods |
Pods active |
designsetgo/jetengine |
JetEngine active |
The resolver uses the same post-password / viewable / protected-meta security gates as the block bindings adapter. Protected meta keys (is_protected_meta() returns true) are never exposed.
Resolved values are validated before injection. Values matching any of the following patterns are silently dropped:
-
url(— prevents loading external or data-URI resources -
expression(— IE legacy CSS expression execution -
javascript:— URI scheme injection -
data:— data URI scheme - Literal
;,{, or}— prevents breaking out of the declaration
Only scalar values returned by the source are accepted; non-scalar (array / object) results are discarded.
Injection happens inside render_block (priority 5). No JavaScript is involved. The generated output looks like:
<div class="wp-block-group" style="--brand-primary:#3a86ff;color:#3a86ff">If the source returns an empty string or null, the property is omitted.
Third-party sources can hook into designsetgo_style_binding_resolve:
add_filter(
'designsetgo_style_binding_resolve',
function ( $value, $source, $args ) {
if ( $source !== 'my-plugin/custom-source' ) {
return $value;
}
return my_plugin_resolve( $args['key'] ?? '' );
},
10,
3
);For registering a full binding source shared with Dynamic Tags, use the public helper designsetgo_register_bindings_source() documented in ../api/BLOCK-BINDINGS.md.
- Style Binding does not apply to
core/freeform,core/missing, orcore/template-part. - The value of a bound CSS property in the editor canvas is not live-previewed; the resolved value appears only on the published/rendered frontend.
- Style Binding resolves the post ID from
$GLOBALS['designsetgo_parent_stack']when inside a Dynamic Query, so each query item renders its own field value.
Auto-generated from
docs/extensions/STYLE-BINDING.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2