Support

Account

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;
    }