diff --git src/bp-xprofile/bp-xprofile-functions.php src/bp-xprofile/bp-xprofile-functions.php
index d84f029..0e3b88f 100644
|
|
function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren |
1022 | 1022 | $displayed_user_id = bp_displayed_user_id(); |
1023 | 1023 | } |
1024 | 1024 | |
1025 | | if ( !$displayed_user_id ) { |
1026 | | return array(); |
1027 | | } |
| 1025 | // Default to empty array |
| 1026 | $hidden_fields = array(); |
1028 | 1027 | |
1029 | | if ( !$current_user_id ) { |
1030 | | $current_user_id = bp_loggedin_user_id(); |
1031 | | } |
| 1028 | if ( $displayed_user_id ) { |
| 1029 | if ( !$current_user_id ) { |
| 1030 | $current_user_id = bp_loggedin_user_id(); |
| 1031 | } |
1032 | 1032 | |
1033 | | // @todo - This is where you'd swap out for current_user_can() checks |
1034 | | $hidden_levels = bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id, $current_user_id ); |
1035 | | $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels ); |
| 1033 | // @todo - This is where you'd swap out for current_user_can() checks |
| 1034 | $hidden_levels = bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id, $current_user_id ); |
| 1035 | $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels ); |
| 1036 | } |
1036 | 1037 | |
1037 | 1038 | /** |
1038 | 1039 | * Filters the ids of fields that are hidden for this displayed/loggedin user pair. |