Contents (3)
The Block Bindings API lets attributes of core blocks — a paragraph’s content, a button’s URL — come from a data source such as post meta.
Register the meta with REST access
register_post_meta( 'case_study', 'project_url', [
'type' => 'string',
'single' => true,
'show_in_rest' => true,
] );
Bind it in block markup
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"core/post-meta","args":{"key":"project_url"}}}}} -->
<p></p>
<!-- /wp:paragraph -->
For custom sources, register one with register_block_bindings_source() and return the value from anywhere.
Check the list of bindable blocks and attributes for your WordPress version; it has grown release by release.
When to build a custom block anyway
If the display logic is complex or several fields must be combined, a custom block or a server-rendered pattern is still the better choice.
$ ./request_review
Facing the same problem in your own store?
Senior WordPress and WooCommerce backend engineering for complex production problems.
Request a Technical Assessment
## Comments