PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2.2
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/FrmStyle.php +160 -292 6.256.2.2 View file →
@@ -3,34 +3,14 @@
3 3 die( 'You are not allowed to call this page directly.' );
4 4 }
5 5
6 6 class FrmStyle {
7 + public $number = false; // Unique ID number of the current instance.
8 + public $id = 0; // the id of the post
7 9
8 10 /**
9 - * The meta name of default template style.
10 - *
11 - * @since 6.14
12 - * @var string
11 + * @param int|string $id The id of the stylsheet or 'default'
13 12 */
14 - private $default_template_style_meta_name = 'frm_style_default';
15 -
16 - /**
17 - * Unique ID number of the current instance.
18 - *
19 - * @var int
20 - */
21 - public $number = false;
22 -
23 - /**
24 - * The id of the post.
25 - *
26 - * @var int|string
27 - */
28 - public $id = 0;
29 -
30 - /**
31 - * @param int|string $id The id of the stylesheet or 'default'.
32 - */
33 13 public function __construct( $id = 0 ) {
34 14 $this->id = $id;
35 15 }
36 16
@@ -40,11 +20,10 @@
40 20 public function get_new() {
41 21 $this->id = 0;
42 22
43 23 $max_slug_value = 2147483647;
44 - // We want to have at least 2 characters in the slug.
45 - $min_slug_value = 37;
46 - $key = base_convert( random_int( $min_slug_value, $max_slug_value ), 10, 36 );
24 + $min_slug_value = 37; // we want to have at least 2 characters in the slug
25 + $key = base_convert( rand( $min_slug_value, $max_slug_value ), 10, 36 );
47 26
48 27 $style = array(
49 28 'post_type' => FrmStylesController::$post_type,
50 29 'ID' => '',
@@ -88,9 +67,9 @@
88 67 }
89 68
90 69 $action_ids = array();
91 70
92 - foreach ( $all_instances as $new_instance ) {
71 + foreach ( $all_instances as $number => $new_instance ) {
93 72 $new_instance = (array) $new_instance;
94 73 $this->id = $new_instance['ID'];
95 74
96 75 if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -99,9 +78,9 @@
99 78 }
100 79
101 80 // Custom CSS is no longer used from the default style, but it is still checked if the Global Setting is missing.
102 81 // Preserve the previous value in case Custom CSS has not been saved as a Global Setting yet.
103 - $custom_css = $new_instance['post_content']['custom_css'] ?? '';
82 + $custom_css = isset( $new_instance['post_content']['custom_css'] ) ? $new_instance['post_content']['custom_css'] : '';
104 83
105 84 // phpcs:ignore WordPress.Security.NonceVerification.Missing
106 85 if ( ! empty( $_POST['frm_style_setting']['post_title'] ) ) {
107 86 // The nonce check happens in FrmStylesController::save_style before this is called.
@@ -112,10 +91,10 @@
112 91 $new_instance['post_content'] = isset( $_POST['frm_style_setting']['post_content'] ) ? $this->sanitize_post_content( wp_unslash( $_POST['frm_style_setting']['post_content'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
113 92 $new_instance['post_content']['custom_css'] = $custom_css;
114 93 unset( $custom_css );
115 94
116 - $new_instance['post_type'] = FrmStylesController::$post_type;
117 - $new_instance['post_status'] = 'publish';
95 + $new_instance['post_type'] = FrmStylesController::$post_type;
96 + $new_instance['post_status'] = 'publish';
118 97
119 98 if ( ! $id ) {
120 99 $new_instance['post_name'] = $new_instance['post_title'];
121 100 }
@@ -140,12 +119,10 @@
140 119 $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
141 120 }
142 121 }
143 122
144 - $new_instance['post_content'] = FrmStylesHelper::update_base_font_size( $new_instance['post_content'], $this->get_defaults() );
145 -
146 123 $action_ids[] = $this->save( $new_instance );
147 - }//end foreach
124 + }
148 125
149 126 $this->save_settings();
150 127
151 128 return $action_ids;
@@ -155,9 +132,9 @@
155 132 * Sanitize custom color values and convert it to valid one filling missing values.
156 133 *
157 134 * @since 5.3.2
158 135 *
159 - * @param string $color_val The color value, by reference.
136 + * @param string $color_val, The color value, by reference.
160 137 * @return void
161 138 */
162 139 private function maybe_sanitize_rgba_value( &$color_val ) {
163 140 if ( preg_match( '/(rgb|rgba)\(/', $color_val ) !== 1 ) {
@@ -164,10 +141,9 @@
164 141 return;
165 142 }
166 143
167 144 $color_val = trim( $color_val );
168 - // Remove leading braces so (rgba(1,1,1,1) doesn't cause inconsistent braces.
169 - $color_val = ltrim( $color_val, '(' );
145 + $color_val = ltrim( $color_val, '(' ); // Remove leading braces so (rgba(1,1,1,1) doesn't cause inconsistent braces.
170 146 $patterns = array( '/rgba\((\s*\d+\s*,){3}[[0-1]\.]+\)/', '/rgb\((\s*\d+\s*,){2}\s*[\d]+\)/' );
171 147 foreach ( $patterns as $pattern ) {
172 148 if ( preg_match( $pattern, $color_val ) === 1 ) {
173 149 return;
@@ -177,11 +153,10 @@
177 153 // Remove all leading ')' braces, then add one back. This way there's always a single brace.
178 154 $color_val = rtrim( $color_val, ')' );
179 155 $color_val .= ')';
180 156
181 - $color_rgba = substr( $color_val, strpos( $color_val, '(' ) + 1, strlen( $color_val ) - strpos( $color_val, '(' ) - 2 );
182 - // Remove any excessive braces from the rgba like rgba((.
183 - $color_rgba = trim( $color_rgba, '()' );
157 + $color_rgba = substr( $color_val, strpos( $color_val, '(' ) + 1, strlen( $color_val ) - strpos( $color_val, '(' ) - 2 );
158 + $color_rgba = trim( $color_rgba, '()' ); // Remove any excessive braces from the rgba like rgba((.
184 159 $length_of_color_codes = strpos( $color_val, '(' );
185 160 $new_color_values = array();
186 161
187 162 // replace empty values by 0 or 1 (if alpha position).
@@ -208,12 +183,12 @@
208 183 $new_value = 1;
209 184 } else {
210 185 $new_value = floatval( $value );
211 186 }
212 - }//end if
187 + }
213 188
214 - $new_color_values[] = $new_value;
215 - }//end foreach
189 + $new_color_values[] = null === $new_value ? $value : $new_value;
190 + }
216 191
217 192 // add more 0s and 1 (if alpha position) if needed.
218 193 $missing_values = $length_of_color_codes - count( $new_color_values );
219 194 if ( $missing_values > 1 ) {
@@ -228,10 +203,9 @@
228 203 }
229 204
230 205 $new_color = implode( ',', $new_color_values );
231 206 $prefix = substr( $color_val, 0, strpos( $color_val, '(' ) + 1 );
232 - // Limit the number of opening braces after rgb/rgba. There should only be one.
233 - $prefix = rtrim( $prefix, '(' ) . '(';
207 + $prefix = rtrim( $prefix, '(' ) . '('; // Limit the number of opening braces after rgb/rgba. There should only be one.
234 208 $new_color = $prefix . $new_color . ')';
235 209
236 210 $color_val = $new_color;
237 211 }
@@ -236,13 +210,28 @@
236 210 $color_val = $new_color;
237 211 }
238 212
239 213 /**
214 + * Unslash everything in post_content but custom_css
215 + *
240 216 * @since 5.0.13
241 217 *
242 218 * @param array $settings
243 219 * @return array
244 220 */
221 + private function unslash_post_content( $settings ) {
222 + $custom_css = isset( $settings['custom_css'] ) ? $settings['custom_css'] : '';
223 + $settings = wp_unslash( $settings );
224 + $settings['custom_css'] = $custom_css;
225 + return $settings;
226 + }
227 +
228 + /**
229 + * @since 5.0.13
230 + *
231 + * @param array $settings
232 + * @return array
233 + */
245 234 public function sanitize_post_content( $settings ) {
246 235 $defaults = $this->get_defaults();
247 236 $valid_keys = array_keys( $defaults );
248 237 $sanitized_settings = array();
@@ -251,110 +240,13 @@
251 240 $sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] );
252 241 } else {
253 242 $sanitized_settings[ $key ] = $defaults[ $key ];
254 243 }
255 -
256 - if ( 'custom_css' !== $key ) {
257 - $sanitized_settings[ $key ] = $this->strip_invalid_characters( $sanitized_settings[ $key ] );
258 - }
259 244 }
260 245 return $sanitized_settings;
261 246 }
262 247
263 248 /**
264 - * Remove any characters that should not be used in CSS.
265 - *
266 - * @since 6.2.3
267 - *
268 - * @param string $setting
269 - * @return string
270 - */
271 - private function strip_invalid_characters( $setting ) {
272 - $characters_to_remove = array( '{', '}', ';', '[', ']' );
273 -
274 - // RGB is handled instead in self::maybe_sanitize_rgba_value.
275 - if ( 0 !== strpos( $setting, 'rgb' ) ) {
276 - $setting = $this->maybe_fix_braces( $setting, $characters_to_remove );
277 - }
278 -
279 - return str_replace( $characters_to_remove, '', $setting );
280 - }
281 -
282 - /**
283 - * @since 6.2.3
284 - *
285 - * @param string $setting
286 - * @param array $characters_to_remove
287 - * @return string
288 - */
289 - private function maybe_fix_braces( $setting, &$characters_to_remove ) {
290 - $number_of_opening_braces = substr_count( $setting, '(' );
291 - $number_of_closing_braces = substr_count( $setting, ')' );
292 -
293 - if ( $number_of_opening_braces === $number_of_closing_braces ) {
294 - return $this->trim_braces( $setting );
295 - }
296 -
297 - if ( $this->should_remove_every_brace( $setting ) ) {
298 - // Add to $characters_to_remove to remove when str_replace is called.
299 - array_push( $characters_to_remove, '(', ')' );
300 - return $setting;
301 - }
302 -
303 - return $this->trim_braces( $setting );
304 - }
305 -
306 - /**
307 - * @since 6.2.3
308 - *
309 - * @param string $input
310 - * @return string
311 - */
312 - private function trim_braces( $input ) {
313 - $output = $input;
314 - // Remove any ( from the start of the string as no CSS values expect at the first character.
315 - if ( $output && in_array( $output[0], array( '(', ')' ), true ) ) {
316 - $output = ltrim( $output, '()' );
317 - }
318 - // Remove extra braces from the end.
319 - if ( in_array( substr( $output, -1 ), array( '(', ')' ), true ) ) {
320 - $output = rtrim( $output, '()' );
321 - if ( false !== strpos( $output, '(' ) ) {
322 - $output .= ')';
323 - }
324 - }
325 - return $output;
326 - }
327 -
328 - /**
329 - * @since 6.2.3
330 - *
331 - * @param string $setting
332 - * @return bool
333 - */
334 - private function should_remove_every_brace( $setting ) {
335 - if ( 0 === strpos( trim( $setting, '()' ), 'calc' ) ) {
336 - // Support calc() sizes. We do not want to remove all braces when calc is used.
337 - return false;
338 - }
339 -
340 - // Matches hex values but also checks for unexpected ( and ).
341 - $looks_like_a_hex_value = preg_match( '/^(?:\()?(?!#?[a-fA-F0-9]*[^\(#\)\da-fA-F])[a-fA-F0-9\(\)]*(?:\))?$/', $setting );
342 - if ( $looks_like_a_hex_value ) {
343 - return true;
344 - }
345 -
346 - // Matches size values but also checks for unexpected ( and ).
347 - // This is case insensitive so it will catch PX, PT, etc, as well.
348 - $looks_like_a_size = preg_match( '/\(?[+-]?\d*\.?\d+(?:px|%|em|rem|ex|pt|pc|mm|cm|in)\)?/i', $setting );
349 - if ( $looks_like_a_size ) {
350 - return true;
351 - }
352 -
353 - return false;
354 - }
355 -
356 - /**
357 249 * @since 3.01.01
358 250 *
359 251 * @param string $setting
360 252 * @return bool
@@ -442,9 +334,9 @@
442 334 /**
443 335 * Delete a style by its post ID.
444 336 *
445 337 * @param int $id
446 - * @return false|WP_Post|null
338 + * @return WP_Post|false|null
447 339 */
448 340 public function destroy( $id ) {
449 341 if ( $id === $this->get_default_style()->ID ) {
450 342 return false;
@@ -452,9 +344,9 @@
452 344 return wp_delete_post( $id );
453 345 }
454 346
455 347 /**
456 - * @return stdClass|WP_Post
348 + * @return WP_Post|stdClass
457 349 */
458 350 public function get_one() {
459 351 if ( 'default' === $this->id ) {
460 352 $style = $this->get_default_style();
@@ -579,9 +471,9 @@
579 471 if ( ! is_array( $settings ) ) {
580 472 return $settings;
581 473 }
582 474
583 - $settings['line_height'] = ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] === 'auto' ? 'normal' : $settings['field_height'];
475 + $settings['line_height'] = ( ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] == 'auto' ) ? 'normal' : $settings['field_height'];
584 476
585 477 if ( ! isset( $settings['form_desc_size'] ) && isset( $settings['description_font_size'] ) ) {
586 478 $settings['form_desc_size'] = $settings['description_font_size'];
587 479 $settings['form_desc_color'] = $settings['description_color'];
@@ -610,144 +502,142 @@
610 502 * @return array
611 503 */
612 504 public function get_defaults() {
613 505 $defaults = array(
614 - 'theme_css' => 'ui-lightness',
615 - 'theme_name' => 'UI Lightness',
506 + 'theme_css' => 'ui-lightness',
507 + 'theme_name' => 'UI Lightness',
616 508
617 - 'center_form' => '',
618 - 'form_width' => '100%',
619 - 'form_align' => 'left',
620 - 'direction' => is_rtl() ? 'rtl' : 'ltr',
621 - 'fieldset' => '0px',
622 - 'fieldset_color' => '000000',
623 - 'fieldset_padding' => '0px 0px 15px 0px',
624 - 'fieldset_bg_color' => '',
509 + 'center_form' => '',
510 + 'form_width' => '100%',
511 + 'form_align' => 'left',
512 + 'direction' => is_rtl() ? 'rtl' : 'ltr',
513 + 'fieldset' => '0px',
514 + 'fieldset_color' => '000000',
515 + 'fieldset_padding' => '0 0 15px 0',
516 + 'fieldset_bg_color' => '',
625 517
626 - 'title_size' => '40px',
627 - 'title_color' => '444444',
628 - 'title_margin_top' => '10px',
629 - 'title_margin_bottom' => '60px',
630 - 'form_desc_size' => '14px',
631 - 'form_desc_color' => '98A2B3',
632 - 'form_desc_margin_top' => '10px',
633 - 'form_desc_margin_bottom' => '25px',
634 - 'form_desc_padding' => '0px',
518 + 'title_size' => '40px',
519 + 'title_color' => '444444',
520 + 'title_margin_top' => '10px',
521 + 'title_margin_bottom' => '60px',
522 + 'form_desc_size' => '14px',
523 + 'form_desc_color' => '666666',
524 + 'form_desc_margin_top' => '10px',
525 + 'form_desc_margin_bottom' => '25px',
526 + 'form_desc_padding' => '0',
635 527
636 - 'font' => '',
637 - 'font_size' => '15px',
638 - 'label_color' => '344054',
639 - 'weight' => 'normal',
640 - 'position' => 'none',
641 - 'align' => 'left',
642 - 'width' => '150px',
643 - 'required_color' => 'F04438',
644 - 'required_weight' => 'bold',
645 - 'label_padding' => '0px 0px 5px 0px',
528 + 'font' => '',
529 + 'font_size' => '15px',
530 + 'label_color' => '3f4b5b',
531 + 'weight' => 'normal',
532 + 'position' => 'none',
533 + 'align' => 'left',
534 + 'width' => '150px',
535 + 'required_color' => 'B94A48',
536 + 'required_weight' => 'bold',
537 + 'label_padding' => '0 0 3px 0',
646 538
647 - 'description_font_size' => '12px',
648 - 'description_color' => '667085',
649 - 'description_weight' => 'normal',
650 - 'description_style' => 'normal',
651 - 'description_align' => 'left',
652 - 'description_margin' => '0px',
539 + 'description_font_size' => '12px',
540 + 'description_color' => '666666',
541 + 'description_weight' => 'normal',
542 + 'description_style' => 'normal',
543 + 'description_align' => 'left',
544 + 'description_margin' => '0',
653 545
654 - 'field_font_size' => '14px',
655 - 'field_height' => '36px',
656 - 'line_height' => 'normal',
657 - 'field_width' => '100%',
658 - 'auto_width' => false,
659 - 'field_pad' => '8px 12px',
660 - 'field_margin' => '20px',
661 - 'field_weight' => 'normal',
662 - 'text_color' => '1D2939',
663 - // 'border_color_hv' => 'cccccc',
664 - 'border_color' => 'D0D5DD',
665 - 'field_border_width' => '1px',
666 - 'field_border_style' => 'solid',
546 + 'field_font_size' => '14px',
547 + 'field_height' => '32px',
548 + 'line_height' => 'normal',
549 + 'field_width' => '100%',
550 + 'auto_width' => false,
551 + 'field_pad' => '6px 10px',
552 + 'field_margin' => '20px',
553 + 'field_weight' => 'normal',
554 + 'text_color' => '555555',
555 + //'border_color_hv' => 'cccccc',
556 + 'border_color' => 'BFC3C8',
557 + 'field_border_width' => '1px',
558 + 'field_border_style' => 'solid',
667 559
668 - 'bg_color' => 'ffffff',
669 - // 'bg_color_hv' => 'ffffff',
670 - 'remove_box_shadow' => '',
671 - 'bg_color_active' => 'ffffff',
672 - 'border_color_active' => '4199FD',
673 - 'remove_box_shadow_active' => '',
674 - 'text_color_error' => '444444',
675 - 'bg_color_error' => 'ffffff',
676 - 'border_color_error' => 'F04438',
677 - 'border_width_error' => '1px',
678 - 'border_style_error' => 'solid',
679 - 'bg_color_disabled' => 'F9FAFB',
680 - 'border_color_disabled' => 'D0D5DD',
681 - 'text_color_disabled' => '667085',
560 + 'bg_color' => 'ffffff',
561 + //'bg_color_hv' => 'ffffff',
562 + 'remove_box_shadow' => '',
563 + 'bg_color_active' => 'ffffff',
564 + 'border_color_active' => '66afe9',
565 + 'remove_box_shadow_active' => '',
566 + 'text_color_error' => '444444',
567 + 'bg_color_error' => 'ffffff',
568 + 'border_color_error' => 'B94A48',
569 + 'border_width_error' => '1px',
570 + 'border_style_error' => 'solid',
571 + 'bg_color_disabled' => 'ffffff',
572 + 'border_color_disabled' => 'E5E5E5',
573 + 'text_color_disabled' => 'A1A1A1',
682 574
683 - 'radio_align' => 'block',
684 - 'check_align' => 'block',
685 - 'check_font_size' => '14px',
686 - 'check_label_color' => '1D2939',
687 - 'check_weight' => 'normal',
575 + 'radio_align' => 'block',
576 + 'check_align' => 'block',
577 + 'check_font_size' => '13px',
578 + 'check_label_color' => '444444',
579 + 'check_weight' => 'normal',
688 580
689 - 'section_font_size' => '18px',
690 - 'section_color' => '344054',
691 - 'section_weight' => 'bold',
692 - 'section_pad' => '32px 0px 3px 0px',
693 - 'section_mar_top' => '30px',
694 - 'section_mar_bottom' => '30px',
695 - 'section_bg_color' => '',
696 - 'section_border_color' => 'EAECF0',
697 - 'section_border_width' => '1px',
698 - 'section_border_style' => 'solid',
699 - 'section_border_loc' => '-top',
700 - 'collapse_icon' => '6',
701 - 'collapse_pos' => 'after',
702 - 'repeat_icon' => '1',
703 - 'repeat_icon_color' => 'ffffff',
581 + 'section_font_size' => '18px',
582 + 'section_color' => '444444',
583 + 'section_weight' => 'bold',
584 + 'section_pad' => '15px 0 3px 0',
585 + 'section_mar_top' => '15px',
586 + 'section_mar_bottom' => '30px',
587 + 'section_bg_color' => '',
588 + 'section_border_color' => 'e8e8e8',
589 + 'section_border_width' => '2px',
590 + 'section_border_style' => 'solid',
591 + 'section_border_loc' => '-top',
592 + 'collapse_icon' => '6',
593 + 'collapse_pos' => 'after',
594 + 'repeat_icon' => '1',
595 + 'repeat_icon_color' => 'ffffff',
704 596
705 597 'submit_style' => false,
706 - 'submit_font_size' => '14px',
598 + 'submit_font_size' => '15px',
707 599 'submit_width' => 'auto',
708 600 'submit_height' => 'auto',
709 - 'submit_bg_color' => '4199FD',
710 - 'submit_border_color' => '4199FD',
601 + 'submit_bg_color' => '579AF6',
602 + 'submit_border_color' => '579AF6',
711 603 'submit_border_width' => '1px',
712 604 'submit_text_color' => 'ffffff',
713 605 'submit_weight' => 'normal',
714 - 'submit_border_radius' => '8px',
606 + 'submit_border_radius' => '4px',
715 607 'submit_bg_img' => '',
716 608 'submit_margin' => '10px',
717 - 'submit_padding' => '8px 16px',
609 + 'submit_padding' => '10px 20px',
718 610 'submit_shadow_color' => 'eeeeee',
719 - 'submit_hover_bg_color' => '3680D3',
720 - 'submit_hover_color' => 'ffffff',
721 - 'submit_hover_border_color' => '3680D3',
722 - 'submit_active_bg_color' => '3680D3',
723 - 'submit_active_color' => 'ffffff',
724 - 'submit_active_border_color' => '3680D3',
611 + 'submit_hover_bg_color' => 'efefef',
612 + 'submit_hover_color' => '444444',
613 + 'submit_hover_border_color' => 'cccccc',
614 + 'submit_active_bg_color' => 'efefef',
615 + 'submit_active_color' => '444444',
616 + 'submit_active_border_color' => 'cccccc',
725 617
726 - 'border_radius' => '8px',
727 - 'error_bg' => 'FEE4E2',
728 - 'error_border' => 'F5B8AA',
729 - 'error_text' => 'F04438',
730 - 'error_font_size' => '14px',
618 + 'border_radius' => '4px',
619 + 'error_bg' => 'F2DEDE',
620 + 'error_border' => 'EBCCD1',
621 + 'error_text' => 'B94A48',
622 + 'error_font_size' => '14px',
731 623
732 - 'success_bg_color' => 'DFF0D8',
733 - 'success_border_color' => 'D6E9C6',
734 - 'success_text_color' => '468847',
735 - 'success_font_size' => '14px',
624 + 'success_bg_color' => 'DFF0D8',
625 + 'success_border_color' => 'D6E9C6',
626 + 'success_text_color' => '468847',
627 + 'success_font_size' => '14px',
736 628
737 - 'important_style' => false,
629 + 'important_style' => false,
738 630
739 - 'progress_bg_color' => 'EAECF0',
740 - 'progress_color' => '1D2939',
741 - 'progress_active_bg_color' => '4199FD',
742 - 'progress_active_color' => 'ffffff',
743 - 'progress_border_color' => 'EAECF0',
744 - 'progress_border_size' => '1px',
745 - 'progress_size' => '30px',
746 - 'custom_css' => '',
747 - 'use_base_font_size' => false,
748 - 'base_font_size' => '15px',
749 - 'field_shape_type' => 'rounded-corner',
631 + 'progress_bg_color' => 'eaeaea',
632 + 'progress_active_color' => 'ffffff',
633 + 'progress_active_bg_color' => '579AF6',
634 + 'progress_color' => '3f4b5b',
635 + 'progress_border_color' => 'E5E5E5',
636 + 'progress_border_size' => '2px',
637 + 'progress_size' => '24px',
638 +
639 + 'custom_css' => '',
750 640 );
751 641
752 642 return apply_filters( 'frm_default_style_settings', $defaults );
753 643 }
@@ -767,22 +657,22 @@
767 657 * @return array
768 658 */
769 659 public static function get_bold_options() {
770 660 return array(
771 - 100 => __( 'Thin', 'formidable' ),
772 - 200 => __( 'Extra Light', 'formidable' ),
773 - 300 => __( 'Light', 'formidable' ),
774 - 'normal' => __( 'Regular', 'formidable' ),
775 - 500 => __( 'Medium', 'formidable' ),
776 - 600 => __( 'Semi Bold', 'formidable' ),
777 - 'bold' => __( 'Bold', 'formidable' ),
778 - 800 => __( 'Extra Bold', 'formidable' ),
779 - 900 => __( 'Black', 'formidable' ),
661 + 100 => 100,
662 + 200 => 200,
663 + 300 => 300,
664 + 'normal' => __( 'normal', 'formidable' ),
665 + 500 => 500,
666 + 600 => 600,
667 + 'bold' => __( 'bold', 'formidable' ),
668 + 800 => 800,
669 + 900 => 900,
780 670 );
781 671 }
782 672
783 673 /**
784 - * Don't let imbalanced font families ruin the whole stylesheet.
674 + * Don't let imbalanced font families ruin the whole stylesheet
785 675 *
786 676 * @param string $value
787 677 * @return string
788 678 */
@@ -790,34 +680,12 @@
790 680 $balanced_characters = array( '"', "'" );
791 681 foreach ( $balanced_characters as $char ) {
792 682 $char_count = substr_count( $value, $char );
793 683 $is_balanced = $char_count % 2 == 0;
794 -
795 - if ( $is_balanced ) {
796 - continue;
797 - }
798 -
799 - if ( $value && $char === $value[ strlen( $value ) - 1 ] ) {
800 - $value = $char . $value;
801 - } else {
684 + if ( ! $is_balanced ) {
802 685 $value .= $char;
803 686 }
804 687 }
688 +
805 689 return $value;
806 - }
807 -
808 - /**
809 - * Get the default template style
810 - *
811 - * @since 6.14
812 - * @param int $style_id The post type "frm_styles" ID.
813 - *
814 - * @return string The json encoded template data
815 - */
816 - public function get_default_template_style( $style_id ) {
817 - $default_template = get_post_meta( (int) $style_id, $this->default_template_style_meta_name, true );
818 - if ( empty( $default_template ) ) {
819 - return FrmAppHelper::prepare_and_encode( $this->get_defaults() );
820 - }
821 - return $default_template;
822 690 }
823 691 }