Changeset 13392 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 01/06/2023 11:35:55 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r13121 r13392 193 193 194 194 $field = bp_xprofile_get_field_types(); 195 $class = isset( $field[ $type] ) ? $field[$type] : '';195 $class = isset( $field[ $type ] ) ? $field[ $type ] : ''; 196 196 197 197 /** … … 558 558 } 559 559 560 $current_visibility_levels[ $field_id] = $visibility_level;560 $current_visibility_levels[ $field_id ] = $visibility_level; 561 561 562 562 return bp_update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels ); … … 1361 1361 // the user-provided setting with the default specified by the admin. 1362 1362 if ( isset( $defaults['allow_custom'] ) && isset( $defaults['default'] ) && 'disabled' == $defaults['allow_custom'] ) { 1363 $user_visibility_levels[ $d_field_id] = $defaults['default'];1363 $user_visibility_levels[ $d_field_id ] = $defaults['default']; 1364 1364 } 1365 1365 } … … 1375 1375 if ( in_array( 1, $field_ids ) ) { 1376 1376 $key = array_search( 1, $field_ids ); 1377 unset( $field_ids[ $key] );1377 unset( $field_ids[ $key ] ); 1378 1378 } 1379 1379 … … 1391 1391 */ 1392 1392 function bp_xprofile_maybe_format_datebox_post_data( $field_id ) { 1393 if ( ! isset( $_POST[ 'field_' . $field_id] ) ) {1394 if ( ! empty( $_POST[ 'field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) {1393 if ( ! isset( $_POST[ 'field_' . $field_id ] ) ) { 1394 if ( ! empty( $_POST[ 'field_' . $field_id . '_day' ] ) && ! empty( $_POST[ 'field_' . $field_id . '_month' ] ) && ! empty( $_POST[ 'field_' . $field_id . '_year' ] ) ) { 1395 1395 // Concatenate the values. 1396 $date_value = $_POST[ 'field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year'];1396 $date_value = $_POST[ 'field_' . $field_id . '_day' ] . ' ' . $_POST[ 'field_' . $field_id . '_month' ] . ' ' . $_POST[ 'field_' . $field_id . '_year' ]; 1397 1397 1398 1398 // Check that the concatenated value can be turned into a timestamp. 1399 1399 if ( $timestamp = strtotime( $date_value ) ) { 1400 1400 // Add the timestamp to the global $_POST that should contain the datebox data. 1401 $_POST[ 'field_' . $field_id] = date( 'Y-m-d H:i:s', $timestamp );1401 $_POST[ 'field_' . $field_id ] = date( 'Y-m-d H:i:s', $timestamp ); 1402 1402 } 1403 1403 }
Note: See TracChangeset
for help on using the changeset viewer.