Support

Account

Home Forums ACF PRO JavaScript API – Get Field Setting Value

Solved

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)

You must be logged in to reply to this topic.

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.