Home › Forums › Gutenberg › ACF Blocks, Javascipt API and field values › Reply To: ACF Blocks, Javascipt API and field values
This is all very useful tx, maybe my idea of data attributes for the front end is not so silly after all but the idea of some inline js is also great. I was almost there with two different init scripts for front end [vanilla] and back end [jQuery], I think I now know the best approach to pursue. The approaches you provided make a lot of sense.
wp_localize_script() is very useful too – I didn’t know that function.
Thanks for your help and advice – I missed in the docs the ACF javascript API being back end only.
Thank you for your time spent responding to this.
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.