Support

Account

Home Forums General Issues Override acf_add_local_field Reply To: Override acf_add_local_field

  • Hi guys

    @bpdp – your second code block is using the function acf_add_local_field – this should be changed to acf_add_local_field_group.

    The function will not allow overrides to a field group. This is to prevent potential errors when adding 2 field groups with the same key by mistake.

    I’m open to the idea of removing this validation, but not sure if it will cause any issues with existing developers.

    Looking at the code, you could edit the field group data like so:

    
    acf_local()->groups[ 'group_55009056525c1' ]['location'] = array( ... );