Ticket #7553: 7553.01.patch
File 7553.01.patch, 2.2 KB (added by , 7 years ago) |
---|
-
src/bp-members/bp-members-functions.php
2072 2072 xprofile_set_field_data( $field_id, $user_id, $current_field ); 2073 2073 } 2074 2074 2075 // Save the visibility level. 2076 $visibility_level = ! empty( $user['meta']['field_' . $field_id . '_visibility'] ) ? $user['meta']['field_' . $field_id . '_visibility'] : 'public'; 2075 /* 2076 * Save the visibility level. 2077 * 2078 * Use the field's default visibility if not present, and 'public' if a 2079 * default visibility is not defined. 2080 */ 2081 $key = "field_{$field_id}_visibility"; 2082 if ( isset( $user['meta'][ $key ] ) ) { 2083 $visibility_level = $user['meta'][ $key ]; 2084 } else { 2085 $vfield = xprofile_get_field( $field_id ); 2086 $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public'; 2087 } 2077 2088 xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); 2078 2089 } 2079 2090 } -
src/bp-members/classes/class-bp-signup.php
388 388 $current_field = $usermeta["field_{$field_id}"]; 389 389 xprofile_set_field_data( $field_id, $user_id, $current_field ); 390 390 391 // Save the visibility level. 392 $visibility_level = ! empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public'; 391 /* 392 * Save the visibility level. 393 * 394 * Use the field's default visibility if not present, and 'public' if a 395 * default visibility is not defined. 396 */ 397 $key = "field_{$field_id}_visibility"; 398 if ( isset( $usermeta[ $key ] ) ) { 399 $visibility_level = $usermeta[ $key ]; 400 } else { 401 $vfield = xprofile_get_field( $field_id ); 402 $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public'; 403 } 393 404 xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); 394 405 } 395 406 }