PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5
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 / modules / framework / blocks-style-manager / field-handlers / dimensions.php
jetformbuilder / modules / framework / blocks-style-manager / field-handlers Last commit date
base.php 3 months ago border.php 3 months ago dimensions.php 3 months ago range.php 3 months ago typography.php 3 months ago
dimensions.php
53 lines
1 <?php
2 namespace Crocoblock\Blocks_Style\Field_Handlers;
3
4 class Dimensions extends Base {
5
6 /**
7 * String with CSS variable macros.
8 * Should be rewritten in the classes with multiple parameters
9 * returned by get_parsed_value() method.
10 */
11 public function css_var_value_format() {
12 return '{{TOP}} {{RIGHT}} {{BOTTOM}} {{LEFT}}';
13 }
14
15 public function get_parsed_value() {
16 if ( ! $this->raw_value ) {
17 return [
18 'top' => '',
19 'right' => '',
20 'bottom' => '',
21 'left' => '',
22 ];
23 }
24
25 if ( is_array( $this->raw_value ) ) {
26 $value = [
27 'top' => isset( $this->raw_value['top'] ) ? $this->raw_value['top'] : '0',
28 'right' => isset( $this->raw_value['right'] ) ? $this->raw_value['right'] : '0',
29 'bottom' => isset( $this->raw_value['bottom'] ) ? $this->raw_value['bottom'] : '0',
30 'left' => isset( $this->raw_value['left'] ) ? $this->raw_value['left'] : '0',
31 ];
32 } else {
33 $value = [
34 'top' => $this->raw_value,
35 'right' => $this->raw_value,
36 'bottom' => $this->raw_value,
37 'left' => $this->raw_value,
38 ];
39 }
40
41 /**
42 * Check - if values has no other units provided - assume it's pixels
43 */
44 foreach ( $value as $side => $val ) {
45 if ( ! preg_match( '/\d+[^\d]+/', $val ) ) {
46 $value[ $side ] = $val . 'px';
47 }
48 }
49
50 return $value;
51 }
52 }
53