PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.8.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.8.0
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 1.2.0 1.2.1 All 78 releases
ablocks / includes / blocks / image / attributes.php

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

176 lines 4.8 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 'blockVersion' => array(
21 'type' => 'number',
22 'default' => '',
23 ),
24 'imgId' => [
25 'type' => 'string',
26 'default' => '',
27 ],
28 'imgIdTablet' => [
29 'type' => 'string',
30 'default' => '',
31 ],
32 'imgIdMobile' => [
33 'type' => 'string',
34 'default' => '',
35 ],
36 'imgUrl' => [
37 'type' => 'string',
38 'source' => 'attribute',
39 'selector' => '.ablocks-image',
40 'attribute' => 'srcset',
41 ],
42 'imgUrlTablet' => [
43 'type' => 'string',
44 'source' => 'attribute',
45 'selector' => '.ablocks-image-tablet',
46 'attribute' => 'srcset',
47 ],
48 'imgUrlMobile' => [
49 'type' => 'string',
50 'source' => 'attribute',
51 'selector' => '.ablocks-image-mobile',
52 'attribute' => 'src',
53 ],
54 'imgSize' => [
55 'type' => 'object',
56 'default' => [
57 'value' => 'large',
58 'valueTablet' => '',
59 'valueMobile' => '',
60 ],
61 ],
62 'aspectRatio' => [
63 'type' => 'object',
64 'default' => [
65 'value' => 'original',
66 'valueTablet' => '',
67 'valueMobile' => '',
68 ],
69 ],
70 'widthHeightWidget' => [
71 'type' => 'object',
72 'default' => [
73 'imgNaturalWidth' => '',
74 'imgNaturalWidthTablet' => '',
75 'imgNaturalWidthMobile' => '',
76 'imgNaturalHeight' => '',
77 'imgNaturalHeightTablet' => '',
78 'imgNaturalHeightMobile' => '',
79 'width' => '',
80 'widthTablet' => '',
81 'widthMobile' => '',
82 'height' => '',
83 'heightTablet' => '',
84 'heightMobile' => '',
85 'customHeight' => false,
86 'customHeightTablet' => false,
87 'customHeightMobile' => false,
88 ],
89 ],
90 'objectFit' => [
91 'type' => 'object',
92 'default' => [
93 'value' => 'default',
94 'valueTablet' => '',
95 'valueMobile' => '',
96 ],
97 ],
98 'imgCaption' => [
99 'type' => 'boolean',
100 'default' => false,
101 ],
102 'position' => [
103 'type' => 'string',
104 'default' => 'below',
105 ],
106 'caption' => [
107 'type' => 'string',
108 'default' => '',
109 ],
110 'captionBackground' => [
111 'type' => 'string',
112 'default' => '',
113 ],
114 'captionColor' => [
115 'type' => 'string',
116 'default' => '',
117 ],
118 'imgLink' => [
119 'type' => 'object',
120 'default' => [
121 'linkDestination' => '',
122 'href' => '',
123 'lightbox' => '',
124 'linkTarget' => '',
125 'rel' => '',
126 'linkClass' => '',
127 ],
128 ],
129 'imgAltText' => [
130 'type' => 'string',
131 'default' => '',
132 ],
133 'onHoverImg' => [
134 'type' => 'string',
135 'default' => 'static',
136 ],
137 'imgTitle' => [
138 'type' => 'string',
139 'default' => '',
140 ],
141 ];
142
143 $attributes = array_merge(
144 $attributes,
145 CssFilter::get_attribute( 'cssFilter' ),
146 CssFilter::get_attribute( 'cssHoverFilter' ),
147 BoxShadow::get_attribute( 'boxShadow' ),
148 Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
149 Alignment::get_attribute( 'captionAlignment', true, [ 'value' => 'left' ] ),
150 Typography::get_attribute( 'captionTypography', true ),
151 Alignment::get_attribute( 'captionPosition', true ),
152 Dimensions::get_attribute( 'captionPadding', true ),
153 Border::get_attribute( 'captionBorder', true ),
154 Border::get_attribute( 'border', true ),
155 Dimensions::get_attribute( 'padding', true ),
156 Range::get_attribute([
157 'attributeName' => 'opacity',
158 'defaultValue' => 1
159 ]),
160 Range::get_attribute([
161 'attributeName' => 'opacityH',
162 'defaultValue' => '',
163 ]),
164 Range::get_attribute([
165 'attributeName' => 'transitionDuration',
166 'defaultValue' => 0.5,
167 ]),
168 Range::get_attribute([
169 'attributeName' => 'filterTransitionDuration',
170 'defaultValue' => 0.5,
171 ]),
172 );
173
174 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
175
176