Home › Forums › ACF PRO › Adding locations to a field group › Reply To: Adding locations to a field group
When ACF calls your filter it sends all of the field group information. You need to alter that information. This means that you need to add values to that nested array.
add_filter(‘acf/get_field_group’, ‘my_modify_field_group_function’);
function my_modify_field_group_function($group) {
if ($field[‘key’] != ‘group_58c6bfd3a0239’) {
// not our field group
return;
}
// add an OR rule to existing location rules for a specific field group
$group[‘location’][] = array(
array(
// your rule here
),
);
return $group;
}
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.