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 +10 -0 2.10.1 → 2.12.8 View file →
@@ -106,8 +106,12 @@
106 106 'placeholder' => [
107 107 'type' => 'string',
108 108 'description' => __( 'Placeholder text shown inside the empty input/textarea or as the empty first option in a dropdown.', 'sureforms' ),
109 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 + ],
110 114 ];
111 115
112 116 /**
113 117 * Filter additional field properties for form ability schemas.
@@ -149,8 +153,14 @@
149 153 $fields[ $index ]['defaultValue'] = sanitize_text_field( $field['defaultValue'] );
150 154 }
151 155 if ( isset( $field['placeholder'] ) && is_string( $field['placeholder'] ) ) {
152 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 + : '';
153 163 }
154 164 if ( ! empty( $field['fieldOptions'] ) && is_array( $field['fieldOptions'] ) ) {
155 165 // @phpstan-ignore-next-line -- $field['fieldOptions'] is validated as array above.
156 166 $field_options = $field['fieldOptions'];