Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippet: How to filter the output of a Block Binding #345

Closed
bph opened this issue Nov 21, 2024 · 6 comments
Closed

Snippet: How to filter the output of a Block Binding #345

bph opened this issue Nov 21, 2024 · 6 comments

Comments

@bph
Copy link
Collaborator

bph commented Nov 21, 2024

Discussed in #341

Originally posted by ndiego November 18, 2024
This snippet would show developers how to use the get_value_callback property of the register_block_bindings_source() function and the block_bindings_source_value filter to modify the output of a Block Binding on the front end. This snippet will provide a solution for implementations like this:

image

@ndiego
Copy link
Member

ndiego commented Dec 13, 2024

This snippet is ready for an initial review: https://docs.google.com/document/d/1KbNMmvzwiF0BgfIpN7FiG6xG6UKP1f0X7h0oxCdgpcI/edit?usp=sharing

Note that I'll create the demo video after the first review in case any changes are needed.

@ndiego ndiego moved this to Needs 1st review in Developer Blog Content Board Dec 13, 2024
@justintadlock justintadlock moved this from Needs 1st review to Done w/ 1st Review in Developer Blog Content Board Dec 16, 2024
@justintadlock
Copy link

Looks good.

@ndiego
Copy link
Member

ndiego commented Dec 16, 2024

Thanks @justintadlock. I'll get the images/video put together today.

@ndiego ndiego moved this from Done w/ 1st Review to Needs 2nd review in Developer Blog Content Board Dec 17, 2024
@ndiego
Copy link
Member

ndiego commented Dec 17, 2024

I added the featured image and the video demo. The public preview is here: https://developer.wordpress.org/news/?p=4850&post_type=snippets&preview=1&_ppp=c3c9473f8d

@ryanwelcher I know you have already taken a look, but would you mind doing the second review? Thanks!

@ryanwelcher
Copy link

Second review done!

@ryanwelcher ryanwelcher moved this from Needs 2nd review to Done w/ 2nd review in Developer Blog Content Board Dec 17, 2024
@ndiego ndiego moved this from Done w/ 2nd review to Published (Done) in Developer Blog Content Board Dec 17, 2024
@ndiego
Copy link
Member

ndiego commented Dec 17, 2024

The snippet has been published here: https://developer.wordpress.org/news/snippets/how-to-filter-the-output-of-a-block-binding/

Social copy:

The Block Bindings API in WordPress provides a powerful way to connect block content with dynamic data sources. Learn how to filter bindings on the front end with this snippet.

@ndiego ndiego closed this as completed Dec 17, 2024
@github-project-automation github-project-automation bot moved this from Published (Done) to Ready to publish in Developer Blog Content Board Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready to publish
Development

No branches or pull requests

4 participants