Support

Account

Forum Replies Created

  • ciao physalis

    i had the same issue just now, using do_action( 'wpml_switch_language', $language ); to change language in an ajax call. but acf options was always returning the ‘original’ language, that was loaded on the inital load.

    i now also added this right after the do_action call:
    add_filter('acf/settings/current_language', 'jnz_acf_set_language');

    and here is the corresponding function:

    function jnz_acf_set_language() {
        return apply_filters( 'wpml_current_language', null );
    }

    this sets the acf language to the current language, but you could also simply return ‘en’ or whatever you prefer..

Viewing 1 post (of 1 total)