Changeset 10232
- Timestamp:
- 10/10/2015 04:13:02 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-screens.php
r10219 r10232 144 144 145 145 // Create errors for required fields without values 146 if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST[ 'field_' . $field_id]) )146 if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST[ 'field_' . $field_id ] ) && ! bp_current_user_can( 'bp_moderate' ) ) 147 147 $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' ); 148 148 } -
trunk/src/bp-xprofile/bp-xprofile-admin.php
r10229 r10232 888 888 } 889 889 890 $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) ;890 $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); 891 891 if ( $is_required[ $field_id ] && empty( $_POST['field_' . $field_id ] ) ) { 892 892 $redirect_to = add_query_arg( 'error', '2', $redirect_to ); -
trunk/src/bp-xprofile/bp-xprofile-functions.php
r10200 r10232 541 541 542 542 function xprofile_check_is_required_field( $field_id ) { 543 $field = new BP_Xprofile_Field( $field_id ); 544 545 // Define locale variable(s). 543 $field = new BP_Xprofile_Field( $field_id ); 546 544 $retval = false; 547 545 548 // Super admins can skip required check. 549 if ( bp_current_user_can( 'bp_moderate' ) && ! is_admin() ) { 550 $retval = false; 551 552 // All other users will use the field's setting. 553 } elseif ( isset( $field->is_required ) ) { 546 if ( isset( $field->is_required ) ) { 554 547 $retval = $field->is_required; 555 548 } -
trunk/src/bp-xprofile/bp-xprofile-screens.php
r10163 r10232 99 99 } 100 100 101 $is_required[ $field_id] = xprofile_check_is_required_field( $field_id);101 $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); 102 102 if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) ) { 103 103 $errors = true; -
trunk/src/bp-xprofile/bp-xprofile-template.php
r10201 r10232 836 836 global $field; 837 837 838 // Define locale variable(s).839 838 $retval = false; 840 839 841 // Super admins can skip required check. 842 if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() ) { 843 $retval = false; 844 845 // All other users will use the field's setting. 846 } elseif ( isset( $field->is_required ) ) { 840 if ( isset( $field->is_required ) ) { 847 841 $retval = $field->is_required; 848 842 }
Note: See TracChangeset
for help on using the changeset viewer.