| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | 23 | protected function set_type( $type ) { |
| 24 | - if ( empty( $type ) ) { | |
| 24 | + if ( ! $type ) { | |
| 25 | 25 | $type = 'text'; |
| 26 | 26 | } |
| 27 | 27 | parent::set_type( $type ); |
| 28 | 28 | } |
| @@ -37,15 +37,14 @@ | ||
| 37 | 37 | |
| 38 | 38 | ob_start(); |
| 39 | 39 | do_action( 'frm_display_added_fields', $field ); |
| 40 | 40 | do_action( 'frm_display_added_' . $this->type . '_field', $field ); |
| 41 | - $input_html = ob_get_contents(); | |
| 42 | - ob_end_clean(); | |
| 41 | + $input_html = ob_get_clean(); | |
| 43 | 42 | |
| 44 | - if ( empty( $input_html ) ) { | |
| 43 | + if ( $input_html ) { | |
| 44 | + echo $input_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 45 | + } else { | |
| 45 | 46 | echo $this->builder_text_field( $name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 46 | - } else { | |
| 47 | - echo $input_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 48 | 47 | } |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | 50 | /** |
| @@ -61,10 +60,9 @@ | ||
| 61 | 60 | ); |
| 62 | 61 | ob_start(); |
| 63 | 62 | do_action( 'frm_form_fields', $this->field, $args['field_name'], $pass_args ); |
| 64 | 63 | do_action( 'frm_form_field_' . $this->type, $this->field, $args['field_name'], $pass_args ); |
| 65 | - $input_html = ob_get_contents(); | |
| 66 | - ob_end_clean(); | |
| 64 | + $input_html = ob_get_clean(); | |
| 67 | 65 | |
| 68 | 66 | return is_string( $input_html ) ? $input_html : ''; |
| 69 | 67 | } |
| 70 | 68 | } |