Home › Forums › Gutenberg › Load JS in editor with block.json › Reply To: Load JS in editor with block.json
I found a way that works, but I don’t know if it’s the best practice today. This uses Bill Erickson’s tutorial. https://www.billerickson.net/building-acf-blocks-with-block-json/#script
So, script
in block.json should point to a function rather than file.
Although, now my function is in the functions.php file instead of with my block. I’m not a PHP expert so maybe there’s a way to keep this more tidy.
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.