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.
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.