PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / classes / control-base-abstract.php

control-base-abstract.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at includes/classes/control-base-abstract.php

34 lines 962 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ABlocks\Classes;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 abstract class ControlBaseAbstract {
9 abstract public static function get_attribute_default_value( $is_responsive = false);
10 abstract public static function get_attribute( $attributeName, $is_responsive = false);
11 abstract public static function get_css( $attribute_value, $property = '', $device = '');
12 public static function has_value( $value ) {
13 return isset( $value ) && ! empty( $value );
14 }
15 public static function get_unit( $attributeValue, $device = '' ) {
16 $unit = $attributeValue['unit'];
17
18 if ( '' === $device ) {
19 return $unit;
20 }
21
22 $unitTablet = $attributeValue['unitTablet'];
23 $unitMobile = $attributeValue['unitMobile'];
24
25 if ( 'Tablet' === $device ) {
26 return '' !== $unitTablet ? $unitTablet : $unit;
27 } elseif ( 'Mobile' === $device ) {
28 return '' !== $unitMobile ? $unitMobile : ( '' !== $unitTablet ? $unitTablet : $unit );
29 }
30
31 return $unit;
32 }
33 }
34