Home › Forums › Backend Issues (wp-admin) › Automatically setting default settings on new multisite install › Reply To: Automatically setting default settings on new multisite install
At the top of the page when editing the field group under screen options you can show the field keys.
A group field is actually a special type of repeater field that always has exactly 1 row. So the difference in the array structure is that you do not need sub arrays for each row.
As far as default values vs blank field entries there is a way to detect this. If a field has been edited but contains no value the the return will usually (but not always) be different than if the field was never set. In most cases the value will be false or null if it was never set and will be an empty string if it was set.
if ($value !== '') {
// value does not exactly equal an empty string
// it was never set
// use a default value
$value = 'my default value';
}
of course this will not always work and you’d have to test different types of fields to see what they are when never set vs having been saved without a 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.