i am having problems hiding the label of the field in views if the field is empty when it accepts unlimited number of values. any idea how to resolve this? i tried this
function alter_form_preprocess_views_view_fields(&$vars) {
// Remove labels if value is empty.
foreach ($vars['fields'] as $id => $field) {
if (!$field->content) {
unset($vars['fields'][$id]);
}
}
}
it didn't work