Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Hide a group of Profile Fields

@artempr

Participant

Hi. If it still an issue , I d recommend you to look at bp-xprofile-settings.php

function bp_xprofile_get_settings_fields( $args = '' ) {
  //if u have ome custom user roles  you can simply filter here which groups to hide  
    if(!current_user_can("owner")){
        $query='5,6,4';
    }else{
        $query='1,3,4,5';
    }
	// Parse the possible arguments.
	$r = bp_parse_args( $args, array(
		'user_id'                => bp_displayed_user_id(),
		'profile_group_id'       => false,
		'hide_empty_groups'      => false,
		'hide_empty_fields'      => false,
		'fetch_fields'           => true,
		'fetch_field_data'       => false,
		'fetch_visibility_level' => true,
		'exclude_groups'         => $query,
		'exclude_fields'         => false
	), 'xprofile_get_settings_fields' );

	return bp_has_profile( $r );
}
Skip to toolbar