Ticket #5317: bp-xprofile-functions.php.patch
File bp-xprofile-functions.php.patch, 1.3 KB (added by , 11 years ago) |
---|
-
bp-xprofile-functions.php
712 712 713 713 // If the current user and displayed user are friends, show all 714 714 } elseif ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) { 715 $hidden_levels = array( ' adminsonly',);715 $hidden_levels = array( 'onlyme' ); 716 716 717 717 // current user is logged in but not friends, so exclude friends-only 718 718 } else { 719 $hidden_levels = array( 'friends', ' adminsonly',);719 $hidden_levels = array( 'friends', 'onlyme' ); 720 720 } 721 721 722 // Current user is not logged in, so exclude friends-only, loggedin, and adminsonly. 722 // current user is not an admin 723 if( !bp_current_user_can( 'bp_moderate' ) ){ 724 $hidden_levels[] = 'adminsonly'; 725 } 726 727 // Current user is not logged in, so exclude friends-only, loggedin, onlyme and adminsonly. 723 728 } else { 724 $hidden_levels = array( 'friends', 'loggedin', 'adminsonly', );729 $hidden_levels = array( 'friends', 'loggedin', 'adminsonly', 'onlyme' ); 725 730 } 726 731 727 return $hidden_levels; 732 // filter the visibility levels 733 return apply_filters( 'bp_xprofile_get_hidden_field_types_for_user', $hidden_levels, $displayed_user_id, $current_user_id ); 728 734 } 729 735 730 736 /**