Home › Forums › Feature Requests › JS hooks – a reference to DOM node of the rendered item in the callback function › Reply To: JS hooks – a reference to DOM node of the rendered item in the callback function
A little update. I’ve just found that ACF exposes a global acf
JS object. So instead of DOM traversing we’re able to use its fields and methods to get the fields data.
For example: acf.fields.google_map
is an object containing a google_map
field type data, a reference to the DOM element, fields settings, etc.
But it returns only one field of a given type (the last one). I didn’t find yet how to get the data of a specific field of a given type. I’ll try to figure it out and I’ll update this post.
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.