diff --git src/bp-xprofile/bp-xprofile-caps.php src/bp-xprofile/bp-xprofile-caps.php
index f34925f..e93c748 100644
|
|
add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 ); |
84 | 84 | */ |
85 | 85 | function bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users( $user_can, $user_id, $capability ) { |
86 | 86 | if ( 'bp_xprofile_change_field_visibility' === $capability && 0 === $user_id ) { |
87 | | $user_can = true; |
| 87 | $field_id = bp_get_the_profile_field_id(); |
| 88 | if ( $field_id && $field = xprofile_get_field( $field_id ) ) { |
| 89 | $user_can = 'allowed' === $field->allow_custom_visibility; |
| 90 | } |
88 | 91 | } |
89 | 92 | |
90 | 93 | return $user_can; |