/home/suroeste/public_html/wp-content/plugins/wpforms/src/Pro/Forms/Fields/DateTime
Edit: /home/suroeste/public_html/wp-content/plugins/wpforms/src/Pro/Forms/Fields/DateTime/EntriesEdit.php (2955B)
wpforms_date_formats(),
'time' => array_combine( $time_formats, $time_formats ), // need a bit extra work due to `wpforms_time_formats()` returned data.
];
// Properly populate subfields with the value.
$inputs = [ 'date', 'time' ];
foreach ( $inputs as $input ) {
// Skip if value is empty.
if ( empty( $entry_field[ $input ] ) ) {
continue;
}
// Populate date dropdowns.
if ( $input === 'date' && $field['date_type'] === 'dropdown' ) {
$field['properties']['inputs']['date']['default'] = [
'd' => gmdate( 'd', $entry_field['unix'] ),
'm' => gmdate( 'm', $entry_field['unix'] ),
'y' => gmdate( 'Y', $entry_field['unix'] ),
];
continue;
}
// Get a submitted date/time format.
$input_format = ! empty( $field[ $input . '_format' ] ) ? $field[ $input . '_format' ] : '';
// Determine a valid date/time format.
$format = isset( $formats[ $input ][ $input_format ] ) ? $formats[ $input ][ $input_format ] : reset( $formats[ $input ][ $input_format ] );
// Generate input value according to the date/time format.
$input_value = ! empty( $entry_field['unix'] ) ? gmdate( $format, $entry_field['unix'] ) : $entry_field[ $input ];
$field['properties'] = $this->field_object->get_field_populated_single_property_value_public( $input_value, $input, $field['properties'], $field );
}
$this->field_object->field_display( $field, null, $form_data );
}
}