Home Forums ACF PRO JavaScript API – Get Field Setting Value


JavaScript API – Get Field Setting Value

  • What’s the best way to get a field setting value from the JavaScript API? For example, if I have created a custom field, with a custom setting of “height”, how would I get that value from the JavaScript API?

    At the acf.getField() seems to just return general information but none of that specific fields setting info. The only thing I can think of at the moment is to set the values as data attribute and get those values in JS. Is that an alternative choice?

  • I don’t expect that any of the fields settings are available using acf.getField(), if they are not already present in the html via some data attribute. If they are not already there then yes, you would need to set these data attributes and then you’d need to get these values from where they are set.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘JavaScript API – Get Field Setting Value’ is closed to new replies.