BuddyPress: Allow not admins to see the private fields of other users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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