🚨 Since the time of recording this, I was informed that a new update to Gutenberg changed this feature: So this approach will not work with ACF until ACF makes some updates on their end. If you really want to use it in the meantime, in addition to using ACF, you'll need to manually register any meta fields using the core WordPress register_post_meta function so that those fields also show up in the REST API.
@@alexandersamokhin You posted this a month ago, so you might've already found the solution, but it's "register_meta()" and NOT "register_post_meta()". Throwing it here in case someone else has issues.
Thank you very much. Finaly customs fields in Gutenberg are starting to come, this is truly a millestone. Better late than never, but we can understand that a ocean liner like WordPress does not maneuver as easily as a boat. Kudo too to Justin Tadlock to show the future power of the block bindings API. This should perhaps calm down Gutenberg's detractors a little.
Agree - this is a milestone! As for the detractors, I'm sure they'll calm down their complaints of Gutenberg when this Block Bindings API is actually shown in the user interface and not just by pasting HTML code into the editor.
Agreed - for now you could combine it with Block Visibility, which lets you hide a block if a postmeta value is empty wordpress.org/plugins/block-visibility/
Yeah definitely. I like that they're shipping the API first and getting the fundamentals down, but it's best to set expectations properly. (I think they went opposite with the menu block- UI first, terrible fundamentals- and are still stuck in a hole). That said, next I'm going to combine this with block variations, which I believe will actually be a way to give this as a UI to clients.
Hey, everybody. I did it just like you did in the video. Also reread the whole article, 3 times uninstalled wordpress completely and put a clean version, tried through ACF custom fields or standard custom fields. Nothing comes out the result is always the same, it just does not output. I do not know what to do, I really need to output custom data and do as before through the template does not work, as the page does not work the usual php. Here already and do not know what to do. Version WordPress 6.4.3
Since the time of recording this, I was informed that a new update to Gutenberg changed this featured. So this approach will not work with ACF until ACF makes some updates on their end. If you really want to use it in the meantime, in addition to using ACF, you'll need to manually register the meta fields using the core WordPress register_post_meta function so that those fields also show up in the REST API. There's been a note in the description already, but I'm going to make a pinned comment as well to make sure it's clear.
This is great! We usually use the ACF Pro plugin and this tutorial really helped me a lot. A question, is there a way to add prefix text right beside the dynamic block binding data? From your example, you have the ISBN number displayed on the single book template, is there a way to add this label 'ISBN: ' before the ISBN number, like this: ISBN: 123456789 ? I did try to use a 'Row' block to wrap the static text in a 'Paragraph' block and the binding in a separate 'Paragraph' block. This is one approach, but if a book doesn't have a ISBN number (the ISBN custom field is empty) this static text 'ISBN:' will still show on the front-end, which I don't want. I want it to return nothing (nor an empty paragraph ). Is there a way to do that? thanks!
So unfortunately that's the best way. What I would add on top of it is the Block Visibility plugin by Nick Diego. With that plugin, you could add a conditional to the row block that basically says 'hide this whole row if there's no value for this specific postmeta' wordpress.org/plugins/block-visibility/
🚨 Since the time of recording this, I was informed that a new update to Gutenberg changed this feature:
So this approach will not work with ACF until ACF makes some updates on their end. If you really want to use it in the meantime, in addition to using ACF, you'll need to manually register any meta fields using the core WordPress register_post_meta function so that those fields also show up in the REST API.
Thank you so much for this one 🙏
Even with registering a field with a register_post_meta function it is not showing on the front-end
@@alexandersamokhin You posted this a month ago, so you might've already found the solution, but it's "register_meta()" and NOT "register_post_meta()". Throwing it here in case someone else has issues.
Thank you very much. Finaly customs fields in Gutenberg are starting to come, this is truly a millestone. Better late than never, but we can understand that a ocean liner like WordPress does not maneuver as easily as a boat. Kudo too to Justin Tadlock to show the future power of the block bindings API. This should perhaps calm down Gutenberg's detractors a little.
Agree - this is a milestone! As for the detractors, I'm sure they'll calm down their complaints of Gutenberg when this Block Bindings API is actually shown in the user interface and not just by pasting HTML code into the editor.
The archive example is pretty crazy, might need to re-think how I approach things once the API is more polished. Thanks for the vid!
Yeah it really changes how you can use it. And it works in any Query Loop, whether it's on the archive page or just a regular page.
This is such an exciting feature and will open up immense possibilities. Love it!
Very well explained!
Thanks! I'm excited to see where this goes in future releases.
Totally looking forward to this! Thanks for the teaser.
If Justin Tadlock is the author of the article, I know it's going to be a banger.
Yep! It's really great. I added a link in the description for future viewers.
Nice video thanks. Will be interesting to see how conditional display is handled if a value is empty...
Agreed - for now you could combine it with Block Visibility, which lets you hide a block if a postmeta value is empty wordpress.org/plugins/block-visibility/
Awesome video, congrats!
Really good work!
I like it. However, It's not ready for prime time until it has a UI.
Yeah definitely. I like that they're shipping the API first and getting the fundamentals down, but it's best to set expectations properly. (I think they went opposite with the menu block- UI first, terrible fundamentals- and are still stuck in a hole).
That said, next I'm going to combine this with block variations, which I believe will actually be a way to give this as a UI to clients.
Hey, everybody.
I did it just like you did in the video. Also reread the whole article, 3 times uninstalled wordpress completely and put a clean version, tried through ACF custom fields or standard custom fields. Nothing comes out the result is always the same, it just does not output.
I do not know what to do, I really need to output custom data and do as before through the template does not work, as the page does not work the usual php.
Here already and do not know what to do.
Version WordPress 6.4.3
Since the time of recording this, I was informed that a new update to Gutenberg changed this featured. So this approach will not work with ACF until ACF makes some updates on their end. If you really want to use it in the meantime, in addition to using ACF, you'll need to manually register the meta fields using the core WordPress register_post_meta function so that those fields also show up in the REST API.
There's been a note in the description already, but I'm going to make a pinned comment as well to make sure it's clear.
This is great! We usually use the ACF Pro plugin and this tutorial really helped me a lot. A question, is there a way to add prefix text right beside the dynamic block binding data? From your example, you have the ISBN number displayed on the single book template, is there a way to add this label 'ISBN: ' before the ISBN number, like this: ISBN: 123456789 ?
I did try to use a 'Row' block to wrap the static text in a 'Paragraph' block and the binding in a separate 'Paragraph' block. This is one approach, but if a book doesn't have a ISBN number (the ISBN custom field is empty) this static text 'ISBN:' will still show on the front-end, which I don't want. I want it to return nothing (nor an empty paragraph ). Is there a way to do that? thanks!
So unfortunately that's the best way. What I would add on top of it is the Block Visibility plugin by Nick Diego. With that plugin, you could add a conditional to the row block that basically says 'hide this whole row if there's no value for this specific postmeta' wordpress.org/plugins/block-visibility/
@@BrianCoords Thank you! Using the Block Visibility plugin works great!