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/fields/textarea-markup.php +15 -17 2.10.0 → 2.12.8 View file →
@@ -157,10 +157,12 @@
157 157 $this->is_richtext ? 'srfm-richtext' : '',
158 158 $this->read_only ? 'srfm-read-only' : '',
159 159 ];
160 160
161 - $classes = Helper::join_strings( $classes );
162 - $random_id = $this->unique_slug . '-' . $this->random_id;
161 + $classes = Helper::join_strings( $classes );
162 + $random_id = $this->unique_slug . '-' . $this->random_id;
163 + $has_counter = ! $this->is_richtext && ( '' !== $this->min_length || '' !== $this->max_length );
164 + $display_limit = $has_counter ? ( '' !== $this->max_length ? $this->max_length : $this->min_length ) : '';
163 165
164 166 ob_start(); ?>
165 167 <div data-block-id="<?php echo esc_attr( $this->block_id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
166 168 <?php echo wp_kses_post( $this->label_markup ); ?>
@@ -180,25 +182,21 @@
180 182 <div id="quill-<?php echo esc_attr( $random_id ); ?>"></div>
181 183 </div>
182 184 <?php } ?>
183 185 </div>
184 - <?php
185 - // Show character counter for plain textareas when min or max length is configured.
186 - if ( ! $this->is_richtext && ( '' !== $this->min_length || '' !== $this->max_length ) ) {
187 - $display_limit = '' !== $this->max_length ? $this->max_length : $this->min_length;
188 - ?>
189 - <div class="srfm-char-counter-wrap">
190 - <span class="srfm-char-counter"
191 - data-counter-limit="<?php echo esc_attr( $display_limit ); ?>"
192 - <?php if ( '' !== $this->min_length ) { ?>
193 - data-counter-min="<?php echo esc_attr( $this->min_length ); ?>"
194 - <?php } ?>
195 - aria-live="polite"
196 - >0/<?php echo esc_html( $display_limit ); ?></span>
197 - </div>
198 - <?php } ?>
199 186 <div class="srfm-error-wrap">
200 187 <?php echo wp_kses_post( $this->error_msg_markup ); ?>
188 + <?php if ( $has_counter ) { ?>
189 + <div class="srfm-char-counter-wrap">
190 + <span class="srfm-char-counter"
191 + data-counter-limit="<?php echo esc_attr( $display_limit ); ?>"
192 + <?php if ( '' !== $this->min_length ) { ?>
193 + data-counter-min="<?php echo esc_attr( $this->min_length ); ?>"
194 + <?php } ?>
195 + aria-live="polite"
196 + >0/<?php echo esc_html( $display_limit ); ?></span>
197 + </div>
198 + <?php } ?>
201 199 </div>
202 200 </div>
203 201
204 202 <?php