PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.3
JetFormBuilder — Dynamic Blocks Form Builder v3.2.3
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 2 years ago calculated-field.php 2 years ago color-picker-field.php 2 years ago date-field.php 2 years ago datetime-field.php 2 years ago form-break-field.php 2 years ago group-break-field.php 2 years ago heading-field.php 2 years ago hidden-field.php 2 years ago image-preview.php 2 years ago map-field.php 2 years ago media-field.php 2 years ago number-field.php 2 years ago preset-media-field.php 2 years ago progress-bar.php 2 years ago radio-field.php 2 years ago range-field.php 2 years ago select-field.php 2 years ago text-field.php 2 years ago textarea-field.php 2 years ago time-field.php 2 years ago
calculated-field.php
61 lines
1 <?php
2 /**
3 * Calculated field template
4 *
5 * @var Calculated_Field_Render $this
6 * @var $args
7 */
8
9 use Jet_Form_Builder\Blocks\Render\Calculated_Field_Render;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 $formula = $this->get_calculated_data( $args );
17
18 if ( empty( $formula ) ) {
19 return;
20 }
21
22 $name = $this->block_type->get_field_name( $args['name'] );
23 $id_attr = $this->block_type->get_field_id();
24 $default_value = ! empty( $args['default'] ) ? $args['default'] : '';
25 $prefix = ! empty( $args['calc_prefix'] ) ? $args['calc_prefix'] : false;
26 $suffix = ! empty( $args['calc_suffix'] ) ? $args['calc_suffix'] : false;
27 $precision = isset( $args['precision'] ) ? $args['precision'] : 0;
28 $is_hidden = isset( $args['calc_hidden'] ) ? filter_var( $args['calc_hidden'], FILTER_VALIDATE_BOOLEAN ) : false;
29
30 $this->add_attribute( 'class', $args['class_name'] );
31 $this->add_attribute( 'data-formula', $formula );
32 $this->add_attribute( 'data-name', $args['name'] );
33 $this->add_attribute( 'data-precision', $precision );
34 $this->add_attribute( 'data-sep-decimal', $args['separate_decimals'] );
35 $this->add_attribute( 'data-sep-thousands', $args['separate_thousands'] );
36 $this->add_attribute( 'data-value-type', $this->args['value_type'] );
37
38 $this->add_attribute( 'class', 'jet-form-builder__calculated-field' );
39 $this->add_attribute( 'class', $is_hidden ? 'jet-form-builder__calculated-field--hidden' : '' );
40
41 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WhiteSpace.PrecisionAlignment.Found
42 ?>
43 <div <?php $this->render_attributes_string(); ?>>
44 <?php if ( false !== $prefix ) : ?>
45 <div class="jet-form-builder__calculated-field-prefix"><?php echo wp_kses_post( $prefix ); ?></div>
46 <?php endif; ?>
47 <input type="hidden"
48 name="<?php echo esc_attr( $name ); ?>"
49 id="<?php echo esc_attr( $id_attr ); ?>"
50 value="<?php echo esc_attr( $default_value ); ?>"
51 class="jet-form-builder__calculated-field-input jet-form-builder__field"
52 data-field-name="<?php echo esc_attr( $args['name'] ); ?>"
53 data-jfb-sync
54 />
55 <div class="jet-form-builder__calculated-field-val"><?php echo wp_kses_post( $this->render_editor_placeholder() ); ?></div>
56 <?php if ( false !== $suffix ) : ?>
57 <div class="jet-form-builder__calculated-field-suffix"><?php echo wp_kses_post( $suffix ); ?></div>
58 <?php endif; ?>
59 </div>
60 <?php
61