| @@ -76,19 +76,18 @@ | ||
| 76 | 76 | <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" value="<?php esc_attr( $instance['title'] ); ?>" /> |
| 77 | 77 | </p> |
| 78 | 78 | <p> |
| 79 | 79 | <label for="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>"><?php esc_html_e( 'Form', 'convertkit' ); ?></label> |
| 80 | - <select name="<?php echo esc_attr( $this->get_field_name( 'form' ) ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>" size="1"> | |
| 81 | - <?php | |
| 82 | - foreach ( $forms->get() as $form ) { | |
| 83 | - ?> | |
| 84 | - <option value="<?php echo esc_attr( $form['id'] ); ?>"<?php selected( $form['id'], $instance['form'] ); ?>> | |
| 85 | - <?php echo esc_attr( $form['name'] ); ?> | |
| 86 | - </option> | |
| 87 | - <?php | |
| 88 | - } | |
| 89 | - ?> | |
| 90 | - </select> | |
| 80 | + <?php | |
| 81 | + echo $forms->get_select_field_all( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 82 | + esc_attr( $this->get_field_name( 'form' ) ), | |
| 83 | + esc_attr( $this->get_field_id( 'form' ) ), | |
| 84 | + array( | |
| 85 | + 'widefat', | |
| 86 | + ), | |
| 87 | + esc_attr( $instance['form'] ) | |
| 88 | + ); | |
| 89 | + ?> | |
| 91 | 90 | </p> |
| 92 | 91 | <?php |
| 93 | 92 | |
| 94 | 93 | return ''; |