PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.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 / blocks / featured-image / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.13.1, at includes/blocks/featured-image/attributes.php

155 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 use ABlocks\Controls\Alignment;
8 use ABlocks\Controls\Border;
9 use ABlocks\Controls\Dimensions;
10 use ABlocks\Controls\Typography;
11 use ABlocks\Controls\CssFilter;
12 use ABlocks\Controls\BoxShadow;
13 use ABlocks\Controls\Range;
14
15 $attributes = [
16 'block_id' => [
17 'type' => 'string',
18 'default' => '',
19 ],
20 'imgId' => [
21 'type' => 'string',
22 'default' => '',
23 ],
24 'imgIdTablet' => [
25 'type' => 'string',
26 'default' => '',
27 ],
28 'imgIdMobile' => [
29 'type' => 'string',
30 'default' => '',
31 ],
32 'imgUrl' => [
33 'type' => 'string',
34 'source' => 'attribute',
35 'selector' => '.ablocks-image',
36 'attribute' => 'srcset',
37 ],
38 'imgUrlTablet' => [
39 'type' => 'string',
40 'source' => 'attribute',
41 'selector' => '.ablocks-image-tablet',
42 'attribute' => 'srcset',
43 ],
44 'imgUrlMobile' => [
45 'type' => 'string',
46 'source' => 'attribute',
47 'selector' => '.ablocks-image-mobile',
48 'attribute' => 'src',
49 ],
50 'imgSize' => [
51 'type' => 'object',
52 'default' => [
53 'value' => 'large',
54 'valueTablet' => '',
55 'valueMobile' => '',
56 ],
57 ],
58 'aspectRatio' => [
59 'type' => 'object',
60 'default' => [
61 'value' => 'original',
62 'valueTablet' => '',
63 'valueMobile' => '',
64 ],
65 ],
66 'widthHeightWidget' => [
67 'type' => 'object',
68 'default' => [
69 'imgNaturalWidth' => '',
70 'imgNaturalWidthTablet' => '',
71 'imgNaturalWidthMobile' => '',
72 'imgNaturalHeight' => '',
73 'imgNaturalHeightTablet' => '',
74 'imgNaturalHeightMobile' => '',
75 'width' => '',
76 'widthTablet' => '',
77 'widthMobile' => '',
78 'height' => '',
79 'heightTablet' => '',
80 'heightMobile' => '',
81 'customHeight' => false,
82 'customHeightTablet' => false,
83 'customHeightMobile' => false,
84 ],
85 ],
86 'objectFit' => [
87 'type' => 'object',
88 'default' => [
89 'value' => 'default',
90 'valueTablet' => '',
91 'valueMobile' => '',
92 ],
93 ],
94 'imgCaption' => [
95 'type' => 'boolean',
96 'default' => false,
97 ],
98 'position' => [
99 'type' => 'string',
100 'default' => 'below',
101 ],
102 'imgLink' => [
103 'type' => 'object',
104 'default' => [
105 'linkDestination' => '',
106 'href' => '',
107 'lightbox' => '',
108 'linkTarget' => '',
109 'rel' => '',
110 'linkClass' => '',
111 ],
112 ],
113 'imgAltText' => [
114 'type' => 'string',
115 'default' => '',
116 ],
117 'onHoverImg' => [
118 'type' => 'string',
119 'default' => 'static',
120 ],
121 'imgTitle' => [
122 'type' => 'string',
123 'default' => '',
124 ],
125 ];
126
127 $attributes = array_merge(
128 $attributes,
129 CssFilter::get_attribute( 'cssFilter' ),
130 CssFilter::get_attribute( 'cssHoverFilter' ),
131 BoxShadow::get_attribute( 'boxShadow' ),
132 Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
133 Border::get_attribute( 'border', true ),
134 Dimensions::get_attribute( 'padding', true ),
135 Range::get_attribute([
136 'attributeName' => 'opacity',
137 'defaultValue' => 1
138 ]),
139 Range::get_attribute([
140 'attributeName' => 'opacityH',
141 'defaultValue' => 1,
142 ]),
143 Range::get_attribute([
144 'attributeName' => 'transitionDuration',
145 'defaultValue' => 0.5,
146 ]),
147 Range::get_attribute([
148 'attributeName' => 'filterTransitionDuration',
149 'defaultValue' => 0.5,
150 ]),
151 );
152
153 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
154
155