Support

Account

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');