Skip to content

Commit

Permalink
fix: using missing data when computing default fields values
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoreMihai committed Mar 14, 2024
1 parent 70b17c6 commit cb9633b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function get_field_default_value( $posted_values, $data_name, $meta ) {
$default_value = is_array( $edit_data ) ? map_deep( $edit_data, 'sanitize_text_field' ) : sanitize_text_field( $_GET[ $data_name ] );
} elseif ( isset( $_POST['ppom']['fields'][ $data_name ] ) && apply_filters( 'ppom_retain_after_add_to_cart', true ) ) {
$edit_data = isset( $_POST['ppom']['fields'][ $data_name ] ) ? $_POST['ppom']['fields'][ $data_name ] : '';
$default_value = is_array( $edit_data ) ? map_deep( $edit_data, 'sanitize_text_field' ) : sanitize_text_field( $_GET[ $data_name ] );
$default_value = is_array( $edit_data ) ? map_deep( $edit_data, 'sanitize_text_field' ) : sanitize_text_field( $_POST['ppom']['fields'][ $data_name ] );
} else {
// Default values in settings
switch ( $type ) {
Expand Down

0 comments on commit cb9633b

Please sign in to comment.