Home › Forums › Backend Issues (wp-admin) › Automatically setting default settings on new multisite install › Reply To: Automatically setting default settings on new multisite install
The first thing is that when updating fields that do not always have values then you need to use the field key. This is covered in the documentation.
I would set the entire group using update_field()
$value = array(
// a group field's value is an array
// sub field key => value pairs
// this is a simple sub field
'field_xxxxx' => 'value',
// a nested group would be a nested array
'field_yyyyy' => array(
// nested group field
'field_zzzzz' => 'value of field',
)
);
update_field('field_ggggg', $value, 'options');
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.