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/views/shared/toggle.php +9 -18 6.266.12.1 View file →
@@ -13,17 +13,16 @@
13 13 die( 'You are not allowed to call this page directly.' );
14 14 }
15 15 ?>
16 16 <?php
17 -$div_class = $args['div_class'] ?? false;
18 -$show_labels = $args['show_labels'] ?? false;
19 -$off_label = $args['off_label'] ?? '';
20 -$on_label = $args['on_label'] ?? 1;
21 -$value = $args['value'] ?? $on_label;
17 +$div_class = isset( $args['div_class'] ) ? $args['div_class'] : false;
18 +$show_labels = isset( $args['show_labels'] ) ? $args['show_labels'] : false;
19 +$off_label = isset( $args['off_label'] ) ? $args['off_label'] : '';
20 +$on_label = isset( $args['on_label'] ) ? $args['on_label'] : 1;
21 +$value = isset( $args['value'] ) ? $args['value'] : $on_label;
22 22 $checked = isset( $args['checked'] ) && ( true === $args['checked'] || false !== strpos( $args['checked'], 'checked="checked"' ) );
23 -$disabled = ! empty( $args['disabled'] );
24 23 $aria_checked = $checked ? 'true' : 'false';
25 -$input_html = $args['input_html'] ?? array();
24 +$input_html = isset( $args['input_html'] ) ? $args['input_html'] : array();
26 25
27 26 $use_container = false;
28 27
29 28 $div_params = array(
@@ -30,9 +29,8 @@
30 29 // This is important when the default style is !important as Pro styling may cause conflicts.
31 30 // It uses --toggle-on-color so just set the variable.
32 31 'style' => '--toggle-on-color:var(--primary-color);',
33 32 );
34 -
35 33 if ( $div_class ) {
36 34 $use_container = true;
37 35 $div_params['class'] = $div_class;
38 36 }
@@ -49,9 +47,9 @@
49 47 }
50 48 ?>
51 49 <label class="frm_toggle_block" <?php FrmAppHelper::array_to_html_params( $div_params, true ); ?>>
52 50 <?php if ( $show_labels && $off_label ) { ?>
53 - <span class="frm_off_label frm_toggle_opt frm-leading-none"><?php echo esc_html( $off_label ); ?></span>
51 + <span class="frm_off_label frm_toggle_opt"><?php echo esc_html( $off_label ); ?></span>
54 52 <?php } ?>
55 53
56 54 <input type="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $id ); ?>" value="<?php echo esc_attr( $value ); ?>"
57 55 <?php checked( $checked, true ); ?>
@@ -57,11 +55,8 @@
57 55 <?php checked( $checked, true ); ?>
58 56 <?php if ( $show_labels && $off_label ) { ?>
59 57 data-off="<?php echo esc_attr( $off_label ); ?>"
60 58 <?php } ?>
61 - <?php if ( $disabled ) { ?>
62 - disabled
63 - <?php } ?>
64 59 <?php
65 60 if ( is_array( $input_html ) ) {
66 61 FrmAppHelper::array_to_html_params( $input_html, true );
67 62 } else {
@@ -69,18 +64,14 @@
69 64 }
70 65 ?>
71 66 />
72 67
73 - <span class="frm_toggle" tabindex="0" role="switch"
74 - <?php echo ! empty( $args['aria-label-attr'] ) ? 'aria-label="' . esc_attr( $args['aria-label-attr'] ) . '"' : ''; ?>
75 - aria-labelledby="<?php echo esc_attr( $id ); ?>_label"
76 - aria-checked="<?php echo esc_attr( $aria_checked ); ?>"
77 - >
68 + <span class="frm_toggle" tabindex="0" role="switch" aria-labelledby="<?php echo esc_attr( $id ); ?>_label" aria-checked="<?php echo esc_attr( $aria_checked ); ?>">
78 69 <span class="frm_toggle_slider"></span>
79 70 </span>
80 71
81 72 <?php if ( $show_labels && $on_label != 1 ) { ?>
82 - <span class="frm_on_label frm_toggle_opt frm-leading-none"><?php FrmAppHelper::kses_echo( $on_label, 'all' ); ?></span>
73 + <span class="frm_on_label frm_toggle_opt"><?php echo FrmAppHelper::kses( $on_label, 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
83 74 <?php } ?>
84 75 </label>
85 76 <?php if ( $use_container ) { ?>
86 77 </div>