Check if a group's subfields have values

by Sam   Last Updated December 19, 2017 12:07 PM

Is it possible to check if a fieldset's subfields have values? If none of the fieldset's fields have values it would return null.

$field = field_get_items('node', $node, 'group_name');
if ($field) {
   // At least 1 of it's sub-fields has a value!
}
else{
   // None of it's subfields have values!
}
Tags : 7 fields


Related Questions



How would I create conditional fields on install?

Updated October 13, 2016 09:03 AM


D8 - edit fields on display node

Updated March 05, 2018 22:07 PM