ACF & Block Bindings API (WordPress 6.5 Beta Preview)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • Let's dig into the new Block Bindings API coming in WordPress 6.5 and see how nicely it plays with Advanced Custom Fields.
    🚨 Free Video Series: 7 Tools for Modern WordPress Development 🚨
    👉 briancoords.co...
    🚨 There's a good chance that this approach will no longer work in WordPress 6.5 with ACF- only with custom fields added natively (github.com/Wor.... ACF is working on an integration, though.
    👉 Justin's Article: developer.word...

ความคิดเห็น • 22

  • @BrianCoords
    @BrianCoords  7 หลายเดือนก่อน +1

    🚨 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.

  • @seiuwatches
    @seiuwatches 8 หลายเดือนก่อน +2

    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!

    • @BrianCoords
      @BrianCoords  8 หลายเดือนก่อน +2

      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.

  • @michellaigrand5767
    @michellaigrand5767 8 หลายเดือนก่อน +2

    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.

    • @BrianCoords
      @BrianCoords  8 หลายเดือนก่อน +2

      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.

  • @Hanneslsm
    @Hanneslsm 8 หลายเดือนก่อน +1

    This is such an exciting feature and will open up immense possibilities. Love it!
    Very well explained!

    • @BrianCoords
      @BrianCoords  8 หลายเดือนก่อน +1

      Thanks! I'm excited to see where this goes in future releases.

  • @seiuwatches
    @seiuwatches 8 หลายเดือนก่อน +2

    If Justin Tadlock is the author of the article, I know it's going to be a banger.

    • @BrianCoords
      @BrianCoords  8 หลายเดือนก่อน +2

      Yep! It's really great. I added a link in the description for future viewers.

  • @Daniel667
    @Daniel667 8 หลายเดือนก่อน +1

    Totally looking forward to this! Thanks for the teaser.

  • @visualmodo
    @visualmodo 7 หลายเดือนก่อน

    Really good work!

  • @SiteStudio
    @SiteStudio 7 หลายเดือนก่อน +3

    I like it. However, It's not ready for prime time until it has a UI.

    • @BrianCoords
      @BrianCoords  7 หลายเดือนก่อน +2

      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.

  • @johnpdev
    @johnpdev 6 หลายเดือนก่อน +1

    Awesome video, congrats!

  • @ivan_makarov_fun
    @ivan_makarov_fun 7 หลายเดือนก่อน +1

    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

    • @BrianCoords
      @BrianCoords  7 หลายเดือนก่อน

      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.

  • @roseseto1358
    @roseseto1358 6 หลายเดือนก่อน +1

    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!

    • @BrianCoords
      @BrianCoords  6 หลายเดือนก่อน +1

      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/

    • @roseseto1358
      @roseseto1358 6 หลายเดือนก่อน +1

      @@BrianCoords Thank you! Using the Block Visibility plugin works great!

  • @thetwopct
    @thetwopct 7 หลายเดือนก่อน +1

    Nice video thanks. Will be interesting to see how conditional display is handled if a value is empty...

    • @BrianCoords
      @BrianCoords  7 หลายเดือนก่อน +1

      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/