Changeset 11295 for trunk/src/bp-members/bp-members-screens.php
- Timestamp:
- 12/13/2016 03:09:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-screens.php
r11032 r11295 150 150 // Loop through the posted fields formatting any datebox values then validate the field. 151 151 foreach ( (array) $profile_field_ids as $field_id ) { 152 if ( !isset( $_POST['field_' . $field_id] ) ) { 153 if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) 154 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) ); 155 } 152 bp_xprofile_maybe_format_datebox_post_data( $field_id ); 156 153 157 154 // Create errors for required fields without values. … … 219 216 $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); 220 217 221 // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile(). 218 /* 219 * Loop through the posted fields, formatting any 220 * datebox values, then add to usermeta. 221 */ 222 222 foreach ( (array) $profile_field_ids as $field_id ) { 223 if ( ! isset( $_POST['field_' . $field_id] ) ) { 224 225 if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { 226 // Concatenate the values. 227 $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; 228 229 // Turn the concatenated value into a timestamp. 230 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); 231 } 232 } 223 bp_xprofile_maybe_format_datebox_post_data( $field_id ); 233 224 234 225 if ( !empty( $_POST['field_' . $field_id] ) )
Note: See TracChangeset
for help on using the changeset viewer.