PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | inc/abilities/forms/form-field-schema.php +18 -0 2.7.1 → 2.12.8 View file →
@@ -101,8 +101,17 @@
101 101 'textLength' => [
102 102 'type' => 'integer',
103 103 'description' => __( 'Maximum character length.', 'sureforms' ),
104 104 ],
105 + // `placeholder` — @since 2.10.0 (added alongside the HTML-form converter)
106 + 'placeholder' => [
107 + 'type' => 'string',
108 + 'description' => __( 'Placeholder text shown inside the empty input/textarea or as the empty first option in a dropdown.', 'sureforms' ),
109 + ],
110 + 'className' => [
111 + 'type' => 'string',
112 + 'description' => __( 'Additional CSS class(es) for the field wrapper. Space-separate multiple classes, e.g. "vk-0 highlight".', 'sureforms' ),
113 + ],
105 114 ];
106 115
107 116 /**
108 117 * Filter additional field properties for form ability schemas.
@@ -141,8 +150,17 @@
141 150 $fields[ $index ]['helpText'] = sanitize_text_field( $field['helpText'] );
142 151 }
143 152 if ( isset( $field['defaultValue'] ) && is_string( $field['defaultValue'] ) ) {
144 153 $fields[ $index ]['defaultValue'] = sanitize_text_field( $field['defaultValue'] );
154 + }
155 + if ( isset( $field['placeholder'] ) && is_string( $field['placeholder'] ) ) {
156 + $fields[ $index ]['placeholder'] = sanitize_text_field( $field['placeholder'] );
157 + }
158 + if ( isset( $field['className'] ) && is_string( $field['className'] ) ) {
159 + $classes = preg_split( '/\s+/', trim( $field['className'] ) );
160 + $fields[ $index ]['className'] = is_array( $classes )
161 + ? implode( ' ', array_filter( array_map( 'sanitize_html_class', $classes ) ) )
162 + : '';
145 163 }
146 164 if ( ! empty( $field['fieldOptions'] ) && is_array( $field['fieldOptions'] ) ) {
147 165 // @phpstan-ignore-next-line -- $field['fieldOptions'] is validated as array above.
148 166 $field_options = $field['fieldOptions'];