PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.5.3
JetFormBuilder — Dynamic Blocks Form Builder v1.5.3
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / templates / fields / calculated-field.php
jetformbuilder / templates / fields Last commit date
action-button.php 4 years ago calculated-field.php 4 years ago checkbox-field.php 4 years ago color-picker-field.php 4 years ago date-field.php 4 years ago datetime-field.php 4 years ago form-break-field.php 4 years ago group-break-field.php 4 years ago heading-field.php 4 years ago hidden-field.php 4 years ago media-field.php 4 years ago number-field.php 4 years ago progress-bar.php 4 years ago radio-field.php 4 years ago range-field.php 4 years ago select-field.php 4 years ago submit-field.php 4 years ago text-field.php 4 years ago textarea-field.php 4 years ago time-field.php 4 years ago wysiwyg-field.php 4 years ago
calculated-field.php
52 lines
1 <?php
2 /**
3 * Calculated field template
4 *
5 * @var \Jet_Form_Builder\Blocks\Render\Calculated_Field_Render $this
6 */
7 $calc_data = $this->get_calculated_data( $args );
8
9 if ( empty( $calc_data['formula'] ) ) {
10 return;
11 }
12
13 $name = $this->block_type->get_field_name( $args['name'] );
14 $default_value = ! empty( $args['default'] ) ? $args['default'] : '';
15 $prefix = ! empty( $args['calc_prefix'] ) ? $args['calc_prefix'] : false;
16 $suffix = ! empty( $args['calc_suffix'] ) ? $args['calc_suffix'] : false;
17 $precision = isset( $args['precision'] ) ? $args['precision'] : 0;
18 $is_hidden = isset( $args['calc_hidden'] ) ? filter_var( $args['calc_hidden'], FILTER_VALIDATE_BOOLEAN ) : false;
19
20 $this->add_attribute( 'class', $args['class_name'] );
21 $this->add_attribute( 'data-formula', $calc_data['formula'] );
22 $this->add_attribute( 'data-name', $args['name'] );
23 $this->add_attribute( 'data-listen_to', htmlspecialchars( wp_json_encode( $calc_data['listen_fields'] ) ) );
24 $this->add_attribute( 'data-precision', $precision );
25 $this->add_attribute( 'data-sep-decimal', $args['separate_decimals'] );
26 $this->add_attribute( 'data-sep-thousands', $args['separate_thousands'] );
27
28 $this->add_attribute( 'class', empty( $this->block_type->get_current_repeater() )
29 ? 'jet-form-builder__calculated-field'
30 : 'jet-form-builder__calculated-field--child'
31 );
32
33 $this->add_attribute( 'class', $is_hidden ? 'jet-form-builder__calculated-field--hidden' : '' );
34
35 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
36 ?>
37 <div <?php $this->render_attributes_string(); ?>>
38 <?php if ( false !== $prefix ) : ?>
39 <div class="jet-form-builder__calculated-field-prefix"><?php echo wp_kses_post( $prefix ); ?></div>
40 <?php endif; ?>
41 <input type="hidden"
42 name="<?php echo esc_attr( $name ); ?>"
43 value="<?php echo esc_attr( $default_value ); ?>"
44 class="jet-form-builder__calculated-field-input jet-form-builder__field"
45 data-field-name="<?php echo esc_attr( $args['name'] ); ?>" />
46 <div class="jet-form-builder__calculated-field-val"><?php echo wp_kses_post( $this->render_editor_placeholder() ); ?></div>
47 <?php if ( false !== $suffix ) : ?>
48 <div class="jet-form-builder__calculated-field-suffix"><?php echo wp_kses_post( $suffix ); ?></div>
49 <?php endif; ?>
50 </div>
51 <?php // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
52