Support

Account

Home Forums ACF PRO Updates & ACF PRO distribution Reply To: Updates & ACF PRO distribution

  • Didn’t know acf hook… I’m doing it on plugins_loaded
    And because I use Polylang, I get back Ids of translated pages in an array, then begin my declaration like this :

        $contact_args = array (
            'key' => 'group_573366ed5685a',
    

    and end it like that :

       foreach($idLangs[1718] as $idLang){
            $contact_args['location'][] = array (
                array (
                    'param' => 'page',
                    'operator' => '==',
                    'value' => $idLang,
                ),
            );
        }
        acf_add_local_field_group($contact_args);
    

    I don’t like it because I don’t like to have to set an id page directly in code but I didn’t find anything else to make it work with polylang.