diff --git src/bp-members/bp-members-screens.php src/bp-members/bp-members-screens.php
index 2377fdc..ebcb53b 100644
|
|
|
function bp_core_screen_signup() { |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // Create errors for required fields without values |
| 147 | | if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) ) |
| | 147 | if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST[ 'field_' . $field_id ] ) && ! bp_current_user_can( 'bp_moderate' ) ) |
| 148 | 148 | $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' ); |
| 149 | 149 | } |
| 150 | 150 | |
diff --git src/bp-xprofile/bp-xprofile-admin.php src/bp-xprofile/bp-xprofile-admin.php
index 1fb255a..136ce88 100644
|
|
|
class BP_XProfile_User_Admin { |
| 852 | 852 | } |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | | $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ); |
| | 855 | $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); |
| 856 | 856 | if ( $is_required[ $field_id ] && empty( $_POST['field_' . $field_id ] ) ) { |
| 857 | 857 | $redirect_to = add_query_arg( 'error', '2', $redirect_to ); |
| 858 | 858 | bp_core_redirect( $redirect_to ); |
diff --git src/bp-xprofile/bp-xprofile-functions.php src/bp-xprofile/bp-xprofile-functions.php
index d84f029..77e9e52 100644
|
|
|
function xprofile_check_is_required_field( $field_id ) { |
| 515 | 515 | // Define locale variable(s) |
| 516 | 516 | $retval = false; |
| 517 | 517 | |
| 518 | | // Super admins can skip required check |
| 519 | | if ( bp_current_user_can( 'bp_moderate' ) && ! is_admin() ) { |
| 520 | | $retval = false; |
| 521 | | |
| 522 | | // All other users will use the field's setting |
| 523 | | } elseif ( isset( $field->is_required ) ) { |
| | 518 | if ( isset( $field->is_required ) ) { |
| 524 | 519 | $retval = $field->is_required; |
| 525 | 520 | } |
| 526 | 521 | |
diff --git src/bp-xprofile/bp-xprofile-screens.php src/bp-xprofile/bp-xprofile-screens.php
index afb4604..de33c66 100644
|
|
|
function xprofile_screen_edit_profile() { |
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | | $is_required[$field_id] = xprofile_check_is_required_field( $field_id ); |
| | 104 | $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); |
| 105 | 105 | if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) ) { |
| 106 | 106 | $errors = true; |
| 107 | 107 | } |
diff --git src/bp-xprofile/bp-xprofile-template.php src/bp-xprofile/bp-xprofile-template.php
index 298b69b..406ab83 100644
|
|
|
function bp_the_profile_field_is_required() { |
| 821 | 821 | // Define locale variable(s) |
| 822 | 822 | $retval = false; |
| 823 | 823 | |
| 824 | | // Super admins can skip required check |
| 825 | | if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() ) { |
| 826 | | $retval = false; |
| 827 | | |
| 828 | | // All other users will use the field's setting |
| 829 | | } elseif ( isset( $field->is_required ) ) { |
| | 824 | if ( isset( $field->is_required ) ) { |
| 830 | 825 | $retval = $field->is_required; |
| 831 | 826 | } |
| 832 | 827 | |