Reply To: User profile privacy radio buttons are 'grayed out'
Also I have added a javascript function to change dynamically the name of the Visibility option in the toogle state, so, now, If you click on the Change Link, select other radio and click on close, you will see the new visibility option.
this is the javascript function:
function changeVisibilityLabel( id, txt ) {
sp = jQuery('#field-visibility-settings-toggle-'+id).find('.current-visibility-level');
sp.text(txt);
}
and the change to the xprofile template:
foreach( bp_xprofile_get_visibility_levels() as $level ) {
$checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
$html .= "\n".'<li><label for="see-field_' . esc_attr( $level['id'] ) . '_'.bp_get_the_profile_field_id().'" onclick="changeVisibilityLabel('.bp_get_the_profile_field_id().', \''.esc_html( $level['label'] ).'\')"><input type="radio" id="see-field_' . esc_attr( $level['id'] ) . '_'.bp_get_the_profile_field_id().'" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . ' /> ' . esc_html( $level['label'] ) . '</label></li>';
}
Of course, this change is in the same function “bp_profile_get_visibility_radio_buttons()”