Skip to content

Commit

Permalink
Merge pull request #272 from Codeinwp/fix/269
Browse files Browse the repository at this point in the history
fix: using missing data when computing default fields values
  • Loading branch information
vytisbulkevicius authored Mar 26, 2024
2 parents fb06378 + cb9633b commit 463a633
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 463a633

Please sign in to comment.