Home › Forums › Backend Issues (wp-admin) › Automatically setting default settings on new multisite install › Reply To: Automatically setting default settings on new multisite install
However, after giving the above, I would not attempt to set these values on the creation of a new site.
First I would try using the field key to get the values. Doing this might return the default values that you have set for the fields.
If using the field keys does not return the default values then I would code the default values where they are used, which is much easier than trying to set all of your default values during site creation.
$value = get_field('your-field-name', 'options');
if (!$value) {
$value = 'the default value';
}
I might event do both of these things at the same time, use the field key to try to get the value and then set a default in code if there is no value.
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.