| @@ -9,9 +9,8 @@ | ||
| 9 | 9 | class FrmFieldDefault extends FrmFieldType { |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @var bool |
| 13 | - * | |
| 14 | 13 | * @since 3.0 |
| 15 | 14 | */ |
| 16 | 15 | protected $holds_email_values = true; |
| 17 | 16 | |
| @@ -20,9 +19,9 @@ | ||
| 20 | 19 | * |
| 21 | 20 | * @return void |
| 22 | 21 | */ |
| 23 | 22 | protected function set_type( $type ) { |
| 24 | - if ( ! $type ) { | |
| 23 | + if ( empty( $type ) ) { | |
| 25 | 24 | $type = 'text'; |
| 26 | 25 | } |
| 27 | 26 | parent::set_type( $type ); |
| 28 | 27 | } |
| @@ -27,10 +26,8 @@ | ||
| 27 | 26 | parent::set_type( $type ); |
| 28 | 27 | } |
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | - * @param string $name | |
| 32 | - * | |
| 33 | 30 | * @return void |
| 34 | 31 | */ |
| 35 | 32 | public function show_on_form_builder( $name = '' ) { |
| 36 | 33 | $field = FrmFieldsHelper::setup_edit_vars( $this->field ); |
| @@ -37,11 +34,12 @@ | ||
| 37 | 34 | |
| 38 | 35 | ob_start(); |
| 39 | 36 | do_action( 'frm_display_added_fields', $field ); |
| 40 | 37 | do_action( 'frm_display_added_' . $this->type . '_field', $field ); |
| 41 | - $input_html = ob_get_clean(); | |
| 38 | + $input_html = ob_get_contents(); | |
| 39 | + ob_end_clean(); | |
| 42 | 40 | |
| 43 | - if ( ! $input_html ) { | |
| 41 | + if ( empty( $input_html ) ) { | |
| 44 | 42 | echo $this->builder_text_field( $name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 45 | 43 | } else { |
| 46 | 44 | echo $input_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 47 | 45 | } |
| @@ -48,10 +46,8 @@ | ||
| 48 | 46 | } |
| 49 | 47 | |
| 50 | 48 | /** |
| 51 | 49 | * @param array $args |
| 52 | - * @param array $shortcode_atts | |
| 53 | - * | |
| 54 | 50 | * @return string |
| 55 | 51 | */ |
| 56 | 52 | public function front_field_input( $args, $shortcode_atts ) { |
| 57 | 53 | $pass_args = array( |
| @@ -60,9 +56,10 @@ | ||
| 60 | 56 | ); |
| 61 | 57 | ob_start(); |
| 62 | 58 | do_action( 'frm_form_fields', $this->field, $args['field_name'], $pass_args ); |
| 63 | 59 | do_action( 'frm_form_field_' . $this->type, $this->field, $args['field_name'], $pass_args ); |
| 64 | - $input_html = ob_get_clean(); | |
| 60 | + $input_html = ob_get_contents(); | |
| 61 | + ob_end_clean(); | |
| 65 | 62 | |
| 66 | 63 | return is_string( $input_html ) ? $input_html : ''; |
| 67 | 64 | } |
| 68 | 65 | } |