Skip to content

Commit

Permalink
Merge pull request #137 from ConvertKit/issue/134
Browse files Browse the repository at this point in the history
Fix CF7 integration for 5.0.5. Fix #137
  • Loading branch information
tnorthcutt authored Jan 7, 2019
2 parents 11b32cf + 117e867 commit f73bbc0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions admin/section/class-convertkit-settings-contactform7.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function cf7_form_callback( $args ) {
$cf7_form_id = $args['cf7_form_id'];
$forms = $args['forms'];

$html = sprintf( '<select id="%1$s_%2$s" name="%1$s[%2$s]">', $this->settings_key, $cf7_form_id );
$html = sprintf( '<select id="%1$s_%2$s" class="widefat" name="%1$s[%2$s]">', $this->settings_key, $cf7_form_id );
$html .= '<option value="default">' . esc_html__( 'None', 'convertkit' ) . '</option>';
foreach ( $forms as $form ) {
$selected = '';
Expand Down Expand Up @@ -271,12 +271,14 @@ public function cf7_name_callback( $args ) {
*/
public function sanitize_settings( $input ) {
// Settings page can be paginated; combine input with existing options.
$output = $this->options;
// If saved options are not an array, start fresh. Fixes rogue saved options
$output = is_array( $this->options ) ? $this->options : array();

foreach ( $input as $key => $value ) {
$output[ $key ] = stripslashes( $input[ $key ] );
$output[ $key ] = sanitize_text_field( $value );
}
$sanitize_hook = 'sanitize' . $this->settings_key;

return apply_filters( $sanitize_hook, $output, $input );
}
}

0 comments on commit f73bbc0

Please sign in to comment.