Appreciating that this may not be the solution everyone’s been looking for but if you’ve been primarily building Gutenblocks using the ACF method and don’t really want to get involved in the complexity of building ES6 style native blocks (I don’t know how else to distinguish them) like I have, then the simplest way I’ve found to create a container block is using this library: https://github.com/ahmadawais/create-guten-block
Provided you’ve updated node and npm then the instructions are really very simple to follow. It does all the Babel shenanigans for you so you don’t even have to worry about the myriad dependencies that you’d normally have to fight with to make your own build process. You literally just cd into the plugins directory and type:
npx create-guten-block my-container
and then cd into the created plugin and do npm start
and activate your plugin.
I’ve just made a little container block which allows InnerBlocks and limits those InnerBlocks to specific ACF style blocks I’ve already built in about 10 minutes.
The first few paragraphs of this tutorial are enough to get a simple version working once you’ve used the above to generate your block plugin: https://www.ibenic.com/enable-inner-blocks-gutenberg/
I’m aware there’s an obvious bug there in using the incorrect variable name when passing to the acf_add_local_field_group function. That’s not the reason it’s not working, that’s just me copypasting from outside a wrapper function and then inside the wrapper function. I AM passing the correct array so ignore that.
Hmm, my slight understanding of this makes me think it might have been that last one. If the post_id was effectively being cast to null perhaps the WP way would have had it apply the data to the page post instead.
Think I’m gonna have to grasp at that particular straw.
Any confirmation yet that this is a bug within ACF?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.