PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.0
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
← All changes | includes/blocks/image/attributes.php +179 -0 2.7.62.13.0 View file →
@@ -1,0 +1,179 @@
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 + 'imageDataAttribute' => [
63 + 'type' => 'object',
64 + 'default' => [],
65 + ],
66 + 'aspectRatio' => [
67 + 'type' => 'object',
68 + 'default' => [
69 + 'value' => 'original',
70 + 'valueTablet' => '',
71 + 'valueMobile' => '',
72 + ],
73 + ],
74 + 'widthHeightWidget' => [
75 + 'type' => 'object',
76 + 'default' => [
77 + 'imgNaturalWidth' => '',
78 + 'imgNaturalWidthTablet' => '',
79 + 'imgNaturalWidthMobile' => '',
80 + 'imgNaturalHeight' => '',
81 + 'imgNaturalHeightTablet' => '',
82 + 'imgNaturalHeightMobile' => '',
83 + 'width' => '',
84 + 'widthTablet' => '',
85 + 'widthMobile' => '',
86 + 'height' => '',
87 + 'heightTablet' => '',
88 + 'heightMobile' => '',
89 + 'customHeight' => false,
90 + 'customHeightTablet' => false,
91 + 'customHeightMobile' => false,
92 + ],
93 + ],
94 + 'objectFit' => [
95 + 'type' => 'object',
96 + 'default' => [
97 + 'value' => 'default',
98 + 'valueTablet' => '',
99 + 'valueMobile' => '',
100 + ],
101 + ],
102 + 'imgCaption' => [
103 + 'type' => 'boolean',
104 + 'default' => false,
105 + ],
106 + 'position' => [
107 + 'type' => 'string',
108 + 'default' => 'below',
109 + ],
110 + 'caption' => [
111 + 'type' => 'string',
112 + 'default' => '',
113 + ],
114 + 'captionBackground' => [
115 + 'type' => 'string',
116 + 'default' => '',
117 + ],
118 + 'captionColor' => [
119 + 'type' => 'string',
120 + 'default' => '',
121 + ],
122 + 'imgLink' => [
123 + 'type' => 'object',
124 + 'default' => [
125 + 'linkDestination' => '',
126 + 'href' => '',
127 + 'lightbox' => '',
128 + 'linkTarget' => '',
129 + 'rel' => '',
130 + 'linkClass' => '',
131 + ],
132 + ],
133 + 'imgAltText' => [
134 + 'type' => 'string',
135 + 'default' => '',
136 + ],
137 + 'onHoverImg' => [
138 + 'type' => 'string',
139 + 'default' => 'static',
140 + ],
141 + 'imgTitle' => [
142 + 'type' => 'string',
143 + 'default' => '',
144 + ],
145 +];
146 +
147 +$attributes = array_merge(
148 + $attributes,
149 + CssFilter::get_attribute( 'cssFilter' ),
150 + CssFilter::get_attribute( 'cssHoverFilter' ),
151 + BoxShadow::get_attribute( 'boxShadow' ),
152 + Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
153 + Alignment::get_attribute( 'captionAlignment', true, [ 'value' => 'left' ] ),
154 + Typography::get_attribute( 'captionTypography', true ),
155 + Alignment::get_attribute( 'captionPosition', true ),
156 + Dimensions::get_attribute( 'captionPadding', true ),
157 + Border::get_attribute( 'captionBorder', true ),
158 + Border::get_attribute( 'border', true ),
159 + Dimensions::get_attribute( 'padding', true ),
160 + Range::get_attribute([
161 + 'attributeName' => 'opacity',
162 + 'defaultValue' => 1
163 + ]),
164 + Range::get_attribute([
165 + 'attributeName' => 'opacityH',
166 + 'defaultValue' => '',
167 + ]),
168 + Range::get_attribute([
169 + 'attributeName' => 'transitionDuration',
170 + 'defaultValue' => 0.5,
171 + ]),
172 + Range::get_attribute([
173 + 'attributeName' => 'filterTransitionDuration',
174 + 'defaultValue' => 0.5,
175 + ]),
176 +);
177 +
178 +return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
179 +