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( ... );
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.