PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.12.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.12.1
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 +18 -48 6.256.12.1 View file →
@@ -3,18 +3,9 @@
3 3 die( 'You are not allowed to call this page directly.' );
4 4 }
5 5
6 6 class FrmStyle {
7 -
8 7 /**
9 - * The meta name of default template style.
10 - *
11 - * @since 6.14
12 - * @var string
13 - */
14 - private $default_template_style_meta_name = 'frm_style_default';
15 -
16 - /**
17 8 * Unique ID number of the current instance.
18 9 *
19 10 * @var int
20 11 */
@@ -27,9 +18,9 @@
27 18 */
28 19 public $id = 0;
29 20
30 21 /**
31 - * @param int|string $id The id of the stylesheet or 'default'.
22 + * @param int|string $id The id of the stylsheet or 'default'.
32 23 */
33 24 public function __construct( $id = 0 ) {
34 25 $this->id = $id;
35 26 }
@@ -42,9 +33,9 @@
42 33
43 34 $max_slug_value = 2147483647;
44 35 // We want to have at least 2 characters in the slug.
45 36 $min_slug_value = 37;
46 - $key = base_convert( random_int( $min_slug_value, $max_slug_value ), 10, 36 );
37 + $key = base_convert( rand( $min_slug_value, $max_slug_value ), 10, 36 );
47 38
48 39 $style = array(
49 40 'post_type' => FrmStylesController::$post_type,
50 41 'ID' => '',
@@ -99,9 +90,9 @@
99 90 }
100 91
101 92 // Custom CSS is no longer used from the default style, but it is still checked if the Global Setting is missing.
102 93 // 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'] ?? '';
94 + $custom_css = isset( $new_instance['post_content']['custom_css'] ) ? $new_instance['post_content']['custom_css'] : '';
104 95
105 96 // phpcs:ignore WordPress.Security.NonceVerification.Missing
106 97 if ( ! empty( $_POST['frm_style_setting']['post_title'] ) ) {
107 98 // The nonce check happens in FrmStylesController::save_style before this is called.
@@ -140,10 +131,8 @@
140 131 $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
141 132 }
142 133 }
143 134
144 - $new_instance['post_content'] = FrmStylesHelper::update_base_font_size( $new_instance['post_content'], $this->get_defaults() );
145 -
146 135 $action_ids[] = $this->save( $new_instance );
147 136 }//end foreach
148 137
149 138 $this->save_settings();
@@ -210,9 +199,9 @@
210 199 $new_value = floatval( $value );
211 200 }
212 201 }//end if
213 202
214 - $new_color_values[] = $new_value;
203 + $new_color_values[] = null === $new_value ? $value : $new_value;
215 204 }//end foreach
216 205
217 206 // add more 0s and 1 (if alpha position) if needed.
218 207 $missing_values = $length_of_color_codes - count( $new_color_values );
@@ -619,9 +608,9 @@
619 608 'form_align' => 'left',
620 609 'direction' => is_rtl() ? 'rtl' : 'ltr',
621 610 'fieldset' => '0px',
622 611 'fieldset_color' => '000000',
623 - 'fieldset_padding' => '0px 0px 15px 0px',
612 + 'fieldset_padding' => '0 0 15px 0',
624 613 'fieldset_bg_color' => '',
625 614
626 615 'title_size' => '40px',
627 616 'title_color' => '444444',
@@ -630,9 +619,9 @@
630 619 'form_desc_size' => '14px',
631 620 'form_desc_color' => '98A2B3',
632 621 'form_desc_margin_top' => '10px',
633 622 'form_desc_margin_bottom' => '25px',
634 - 'form_desc_padding' => '0px',
623 + 'form_desc_padding' => '0',
635 624
636 625 'font' => '',
637 626 'font_size' => '15px',
638 627 'label_color' => '344054',
@@ -641,9 +630,9 @@
641 630 'align' => 'left',
642 631 'width' => '150px',
643 632 'required_color' => 'F04438',
644 633 'required_weight' => 'bold',
645 - 'label_padding' => '0px 0px 5px 0px',
634 + 'label_padding' => '0 0 5px 0',
646 635
647 636 'description_font_size' => '12px',
648 637 'description_color' => '667085',
649 638 'description_weight' => 'normal',
@@ -648,9 +637,9 @@
648 637 'description_color' => '667085',
649 638 'description_weight' => 'normal',
650 639 'description_style' => 'normal',
651 640 'description_align' => 'left',
652 - 'description_margin' => '0px',
641 + 'description_margin' => '0',
653 642
654 643 'field_font_size' => '14px',
655 644 'field_height' => '36px',
656 645 'line_height' => 'normal',
@@ -688,9 +677,9 @@
688 677
689 678 'section_font_size' => '18px',
690 679 'section_color' => '344054',
691 680 'section_weight' => 'bold',
692 - 'section_pad' => '32px 0px 3px 0px',
681 + 'section_pad' => '32px 0 3px 0',
693 682 'section_mar_top' => '30px',
694 683 'section_mar_bottom' => '30px',
695 684 'section_bg_color' => '',
696 685 'section_border_color' => 'EAECF0',
@@ -743,11 +732,8 @@
743 732 'progress_border_color' => 'EAECF0',
744 733 'progress_border_size' => '1px',
745 734 'progress_size' => '30px',
746 735 'custom_css' => '',
747 - 'use_base_font_size' => false,
748 - 'base_font_size' => '15px',
749 - 'field_shape_type' => 'rounded-corner',
750 736 );
751 737
752 738 return apply_filters( 'frm_default_style_settings', $defaults );
753 739 }
@@ -767,17 +753,17 @@
767 753 * @return array
768 754 */
769 755 public static function get_bold_options() {
770 756 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' ),
757 + 100 => 100,
758 + 200 => 200,
759 + 300 => 300,
760 + 'normal' => __( 'normal', 'formidable' ),
761 + 500 => 500,
762 + 600 => 600,
763 + 'bold' => __( 'bold', 'formidable' ),
764 + 800 => 800,
765 + 900 => 900,
780 766 );
781 767 }
782 768
783 769 /**
@@ -802,22 +788,6 @@
802 788 $value .= $char;
803 789 }
804 790 }
805 791 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 792 }
823 793 }