PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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
formidable / classes / views / styles / components / templates / text-toggle.php

text-toggle.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at classes/views/styles/components/templates/text-toggle.php

40 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 $options = $component['options'] ?? array();
7 ?>
8 <div class="frm-text-toggle-component frm-radio-component <?php echo esc_attr( $component_class ); ?>">
9 <div class="frm-radio-container frm-flex-justify">
10 <?php
11 $is_default_checked = isset( $component['default_value'] ) ? empty( $field_value ) && '' !== $component['default_value'] : empty( $field_value );
12
13 foreach ( $options as $index => $option ) {
14 $input_attrs = array(
15 'id' => 'frm-text-toggle-' . $field_name . '-' . $index,
16 'value' => $option['value'] ?? '',
17 );
18
19 if ( empty( $component['input_attrs_str'] ) ) {
20 $input_attrs['type'] = 'radio';
21 }
22 ?>
23 <input
24 <?php
25 echo $component['input_attrs_str'] ?? $field_name; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
26 FrmAppHelper::array_to_html_params( $input_attrs, true );
27 checked( ( $is_default_checked && 0 === $index ) || $option['value'] == $field_value, true ); // phpcs:ignore Universal.Operators.StrictComparisons
28 ?>
29 />
30 <label class="frm-force-flex-center <?php echo esc_attr( $option['classes'] ?? '' ); ?>" for="<?php echo esc_attr( $input_attrs['id'] ); ?>" tabindex="0" data-value="<?php echo esc_attr( $input_attrs['value'] ); ?>" <?php echo $option['custom_attrs'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
31 <span class="frm-toggle-label"><?php echo esc_html( $option['label'] ?? '' ); ?></span>
32 </label>
33 <?php
34 }//end foreach
35 ?>
36
37 <span class="frm-radio-active-tracker"></span>
38 </div>
39 </div>
40