Support

Account

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

  • Hey,

    I’m not looking for help 🙂 I’ve found a solution already (not a clean solution, but at least it works). It was easy. I just wanted to share the knowledge. For many people, it might not be so straightforward because there’s no documentation for ACF JS objects.

    Here’s the another example where I make use of the acf.fields object.

    But thanks for the links anyway. Sometimes creating a new field type that extends the built-in field might be a better idea than trying to “hack” the existing fields.

    PS
    I would appreciate if @eliot commented on this topic. The only thing I wasn’t able to find out is how to get all the instances of the field of a given type.

    As I said in the previous comment: an acf.fields.{FIELD_TYPE} object contains only a one field of the given type. How to get the other fields?