Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Created April 3, 2015 15:02
Show Gist options
  • Select an option

  • Save modemlooper/989cdd4ed2349eef0ee0 to your computer and use it in GitHub Desktop.

Select an option

Save modemlooper/989cdd4ed2349eef0ee0 to your computer and use it in GitHub Desktop.
hide edit profile fields - BuddyPress
function bpfr_hide_profile_field_group( $retval ) {
if ( bp_is_active( 'xprofile' ) ) :
// hide profile group/field to all except admin
if ( !is_super_admin() ) {
//exlude fields, separated by comma
$retval['exclude_fields'] = '1';
//exlude field groups, separated by comma
$retval['exclude_groups'] = '1';
}
return $retval;
endif;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment