Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions stripe/models/FrmTransLiteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public function get_credit_card_field_id( $form_atts ) {
* Show the dropdown fields for custom form fields.
* This is used for first and last name fields.
*
* @since x.x The `$field_atts` might contain `skipped_fields`. By default, the submit field is skipped.
*
* @param array $form_atts
* @param array $field_atts
* @return void
Expand All @@ -166,12 +168,21 @@ public function show_fields_dropdown( $form_atts, $field_atts ) {
if ( ! isset( $field_atts['allowed_fields'] ) ) {
$field_atts['allowed_fields'] = array();
}

if ( ! isset( $field_atts['skipped_fields'] ) ) {
$field_atts['skipped_fields'] = array( FrmSubmitHelper::FIELD_TYPE );
}

$has_field = false;
?>
<select class="frm_with_left_label" name="<?php echo esc_attr( $this->get_field_name( $field_atts['name'] ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( $field_atts['name'] ) ); ?>">
<option value=""><?php esc_html_e( '&mdash; Select &mdash;' ); ?></option>
<?php
foreach ( $form_atts['form_fields'] as $field ) {
if ( $field_atts['skipped_fields'] && in_array( $field->type, (array) $field_atts['skipped_fields'], true ) ) {
continue;
}

$type_is_allowed = empty( $field_atts['allowed_fields'] ) || in_array( $field->type, (array) $field_atts['allowed_fields'], true );

if ( ! $type_is_allowed ) {
Expand Down