Home › Forums › ACF PRO › get_field(‘field_name’, ‘option’) not working while called at CF7 hook › Reply To: get_field(‘field_name’, ‘option’) not working while called at CF7 hook
I’m using “ACF options for PolyLang” plugin so my options can be defined separately for each language (and a ‘fallback’ using ‘show all languages’ option from WP admin bar).
In my hook ACF couldn’t read options saved for current language (probably due to some issue of “ACF options for PolyLang” hooks). It returned the ‘fallback’ values for all languages (default ACF behavior).
The solution:
When the real cause was revealed the solution was pretty simple. I just had to call get_field() like this:
get_field(get_locale() . '_form-locations', 'options');
or hard-coded:
get_field('pl_PL_form-locations', 'options');
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.