diff --git bp-templates/bp-legacy/js/buddypress.js bp-templates/bp-legacy/js/buddypress.js
index 889c919..9fc7fed 100644
|
|
jq(document).ready( function() { |
834 | 834 | |
835 | 835 | jq('.field-visibility-settings-close').on( 'click', function() { |
836 | 836 | var settings_div = jq(this).parent(); |
| 837 | var vis_setting_text = jq(this).siblings('fieldset').find('input[type=radio]:checked').parent('label').text(); |
837 | 838 | |
838 | 839 | jq(settings_div).slideUp( 400, function(){ |
839 | 840 | jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800); |
| 841 | jq(settings_div).siblings('.field-visibility-settings-toggle').children('.current-visibility-level').html(vis_setting_text); |
840 | 842 | }); |
841 | 843 | |
842 | 844 | return false; |
843 | 845 | } ); |
844 | 846 | |
| 847 | jq("#profile-edit-form input:not(:submit),#profile-edit-form textarea,#profile-edit-form select").change(function(){ |
| 848 | |
| 849 | var shouldconfirm = true; |
| 850 | |
| 851 | jq('#profile-edit-form input:submit').on( 'click', function() { |
| 852 | shouldconfirm = false; |
| 853 | }); |
| 854 | |
| 855 | window.onbeforeunload = function(e) { |
| 856 | if ( shouldconfirm ) { |
| 857 | return 'You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?'; |
| 858 | } |
| 859 | }; |
| 860 | }); |
845 | 861 | |
846 | 862 | /** Friendship Requests **************************************/ |
847 | 863 | |
diff --git bp-xprofile/bp-xprofile-template.php bp-xprofile/bp-xprofile-template.php
index c6ecda3..5a949e3 100644
|
|
function bp_the_profile_field_visibility_level() { |
730 | 730 | */ |
731 | 731 | function bp_get_the_profile_field_visibility_level() { |
732 | 732 | global $field; |
733 | | |
734 | | $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| 733 | //On the registration page, values stored in POST should take precedence over default visibility |
| 734 | if ( bp_is_register_page() && !empty( $_POST['field_' . $field->id . '_visibility'] ) ) { |
| 735 | $retval = $_POST['field_' . $field->id . '_visibility']; |
| 736 | } else { |
| 737 | $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| 738 | } |
735 | 739 | |
736 | 740 | return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval ); |
737 | 741 | } |
… |
… |
function bp_the_profile_field_visibility_level_label() { |
747 | 751 | */ |
748 | 752 | function bp_get_the_profile_field_visibility_level_label() { |
749 | 753 | global $field; |
| 754 | //On the registration page, values stored in POST should take precedence over default visibility |
| 755 | if ( bp_is_register_page() && !empty( $_POST['field_' . $field->id . '_visibility'] ) ) { |
| 756 | $level = $_POST['field_' . $field->id . '_visibility']; |
| 757 | } else { |
| 758 | $level = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
| 759 | } |
750 | 760 | |
751 | | $level = !empty( $field->visibility_level ) ? $field->visibility_level : 'public'; |
752 | 761 | $fields = bp_xprofile_get_visibility_levels(); |
753 | 762 | |
754 | 763 | return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] ); |