PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.07
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.07
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/fields/FrmFieldTextarea.php +11 -49 6.255.0.07 View file →
@@ -13,16 +13,8 @@
13 13 * @since 3.0
14 14 */
15 15 protected $type = 'textarea';
16 16
17 - /**
18 - * @var bool
19 - */
20 - protected $array_allowed = false;
21 -
22 - /**
23 - * @return bool[]
24 - */
25 17 protected function field_settings_for_type() {
26 18 return array(
27 19 'size' => true,
28 20 'clear_on_focus' => true,
@@ -28,11 +20,8 @@
28 20 'clear_on_focus' => true,
29 21 );
30 22 }
31 23
32 - /**
33 - * @return array
34 - */
35 24 protected function extra_field_opts() {
36 25 return array(
37 26 'max' => '5',
38 27 );
@@ -39,36 +28,22 @@
39 28 }
40 29
41 30 /**
42 31 * @param string $name
43 - *
44 - * @return void
45 32 */
46 33 public function show_on_form_builder( $name = '' ) {
47 - $size = FrmField::get_option( $this->field, 'size' );
48 - $max = FrmField::get_option( $this->field, 'max' );
34 + $size = FrmField::get_option( $this->field, 'size' );
35 + $size_html = $size ? ' style="width:' . esc_attr( $size . ( is_numeric( $size ) ? 'px' : '' ) ) . '";' : '';
49 36
50 - $html_atts = array(
51 - 'name' => $this->html_name( $name ),
52 - 'id' => $this->html_id(),
53 - 'rows' => $max,
54 - 'class' => 'dyn_default_value',
55 - 'placeholder' => FrmField::get_option( $this->field, 'placeholder' ),
56 - );
57 - echo '<textarea';
58 - FrmAppHelper::array_to_html_params( $html_atts, true );
37 + $max = FrmField::get_option( $this->field, 'max' );
38 + $default_value = FrmAppHelper::esc_textarea( force_balance_tags( $this->get_field_column( 'default_value' ) ) );
59 39
60 - if ( $size ) {
61 - if ( is_numeric( $size ) ) {
62 - $size .= 'px';
63 - }
64 - $style = 'width:' . $size . ';';
65 - echo ' style="' . esc_attr( $style ) . '"';
66 - }
67 -
68 - echo '>';
69 - echo FrmAppHelper::esc_textarea( force_balance_tags( $this->get_field_column( 'default_value' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
70 - echo '</textarea>';
40 + echo '<textarea name="' . esc_attr( $this->html_name( $name ) ) . '" ' . // WPCS: XSS ok.
41 + $size_html // WPCS: XSS ok.
42 + . ' rows="' . esc_attr( $max ) . '" ' .
43 + 'id="' . esc_attr( $this->html_id() ) . '" class="dyn_default_value">' .
44 + $default_value // WPCS: XSS ok.
45 + . '</textarea>';
71 46 }
72 47
73 48 protected function prepare_display_value( $value, $atts ) {
74 49 FrmFieldsHelper::run_wpautop( $atts, $value );
@@ -76,21 +51,8 @@
76 51 return $value;
77 52 }
78 53
79 54 /**
80 - * @since 6.0
81 - *
82 - * @param array $field
83 - * @param string $default_name
84 - * @param mixed $default_value
85 - *
86 - * @return void
87 - */
88 - public function show_default_value_field( $field, $default_name, $default_value ) {
89 - include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/textarea-default-value-field.php';
90 - }
91 -
92 - /**
93 55 * @param array $args
94 56 * @param array $shortcode_atts
95 57 *
96 58 * @return string
@@ -97,9 +59,9 @@
97 59 */
98 60 public function front_field_input( $args, $shortcode_atts ) {
99 61 $input_html = $this->get_field_input_html_hook( $this->field );
100 62 $this->add_aria_description( $args, $input_html );
101 - $rows = $this->field['max'] ? 'rows="' . esc_attr( $this->field['max'] ) . '" ' : '';
63 + $rows = ( $this->field['max'] ) ? 'rows="' . esc_attr( $this->field['max'] ) . '" ' : '';
102 64
103 65 return '<textarea name="' . esc_attr( $args['field_name'] ) . '" id="' . esc_attr( $args['html_id'] ) . '" ' .
104 66 $rows . $input_html . '>' .
105 67 FrmAppHelper::esc_textarea( $this->field['value'] ) .