How to hide visibility options for empty values
-
Hi there,
In Setting > Profile, I want to hide rows of fields that do not have a value set for them.
Currently the code is as such:
[ edited – please use the ‘code’ button when sharing code. ]<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <tr <?php bp_field_css_class(); ?>> <td class="field-name"><?php bp_the_profile_field_name(); ?></td> <td class="field-visibility"><?php bp_profile_settings_visibility_select(); ?></td> </tr> <?php endwhile; ?>
I have tried to add <?php if ( bp_field_has_data() ) : ?> but that doesn’t seem to hide the row either. I tried doing a var_dump of the bp_the_profile_field_value() but it returns NULL for all fields even though some of them do have values.
Any suggestions on what I might be doing wrong here?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to hide visibility options for empty values’ is closed to new replies.