Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaFFik/7b6fd471a972b9b170648822924e89c7 to your computer and use it in GitHub Desktop.
Save slaFFik/7b6fd471a972b9b170648822924e89c7 to your computer and use it in GitHub Desktop.
BuddyPress: Allow not admins to see the private fields of other users
<?php
function drs_bp_xprofile_reset_hidden_field_types_for_user( $hidden_levels, $displayed_user_id, $current_user_id ) {
if( $current_user_id == 9 ){ // or any other user role or user type check
return array();
}
return $hidden_levels;
}
add_filter( 'bp_xprofile_get_hidden_fields_for_user', 'drs_bp_xprofile_reset_hidden_field_types_for_user', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment