PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.16.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.16.0
2.16.0 2.15.0 2.14.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 All 83 releases
← All changes | includes/blocks/price-menu/attributes.php +188 -0 2.7.5 → 2.16.0 View file →
@@ -1,0 +1,188 @@
1 +<?php
2 +
3 +use ABlocks\Controls\Border;
4 +use ABlocks\Controls\Dimensions;
5 +use ABlocks\Controls\Alignment;
6 +use ABlocks\Controls\GroupButton;
7 +use ABlocks\Controls\Range;
8 +use ABlocks\Controls\Typography;
9 +use ABlocks\Controls\TextShadow;
10 +use ABlocks\Controls\TextStroke;
11 +use ABlocks\Controls\Icon;
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit;
14 +}
15 +
16 +$attributes = [
17 + 'block_id' => [
18 + 'type' => 'string',
19 + 'default' => '',
20 + ],
21 + 'blockVersion' => array(
22 + 'type' => 'number',
23 + 'default' => '',
24 + ),
25 + 'device' => [
26 + 'type' => 'string',
27 + 'default' => '',
28 + ],
29 + 'columnGap' => [
30 + 'type' => 'object',
31 + 'default' => [
32 + 'value' => 20,
33 + 'valueTablet' => 20,
34 + 'valueMobile' => 10,
35 + ],
36 + ],
37 + 'allowIcon' => [
38 + 'type' => 'boolean',
39 + 'default' => true,
40 + ],
41 + 'allowDescription' => [
42 + 'type' => 'boolean',
43 + 'default' => true,
44 + ],
45 + 'allowDivider' => [
46 + 'type' => 'boolean',
47 + 'default' => true,
48 + ],
49 + 'itemBackgroundH' => [
50 + 'type' => 'string',
51 + 'default' => '',
52 + ],
53 + 'itemBackground' => [
54 + 'type' => 'string',
55 + 'default' => '',
56 + ],
57 + 'transition' => [
58 + 'type' => 'number',
59 + 'default' => '',
60 + ],
61 + 'titleTag' => [
62 + 'type' => 'string',
63 + 'default' => 'p',
64 + ],
65 + 'titleColor' => [
66 + 'type' => 'string',
67 + 'default' => '#13191B',
68 + ],
69 + 'descriptionTag' => [
70 + 'type' => 'string',
71 + 'default' => 'p',
72 + ],
73 + 'descriptionColor' => [
74 + 'type' => 'string',
75 + 'default' => '#595959',
76 + ],
77 + // divider related attributes
78 + 'placeDivider' => [
79 + 'type' => [ 'string', 'object' ],
80 + 'default' => 'near title',
81 + ],
82 + 'dividerPatternUrl' => [
83 + 'type' => 'string',
84 + 'default' => 'dashed',
85 + ],
86 + 'dividerType' => [
87 + 'type' => 'string',
88 + 'default' => 'dashed',
89 + ],
90 + 'color' => [
91 + 'type' => 'string',
92 + 'default' => '#000000',
93 + ],
94 + 'placePrice' => [
95 + 'type' => [ 'string', 'object' ],
96 + 'default' => 'right',
97 + ],
98 + 'priceTag' => [
99 + 'type' => 'string',
100 + 'default' => 'p',
101 + ],
102 + 'priceColor' => [
103 + 'type' => 'string',
104 + 'default' => '#595959',
105 + ],
106 + 'priceAlignmentCustom' => [
107 + 'type' => 'boolean',
108 + 'default' => false,
109 + ],
110 +];
111 +
112 +$attributes = array_merge(
113 + $attributes,
114 + Typography::get_attribute('titleTypography', true, [
115 + 'weight' => '600',
116 + ]),
117 + TextShadow::get_attribute( 'titleTextShadow' ),
118 + TextStroke::get_attribute( 'titleTextStroke', true ),
119 + Typography::get_attribute( 'descriptionTypography', true ),
120 + TextShadow::get_attribute( 'descriptionTextShadow' ),
121 + TextStroke::get_attribute( 'descriptionTextStroke', true ),
122 + Typography::get_attribute( 'priceTypography', true ),
123 + TextShadow::get_attribute( 'priceTextShadow' ),
124 + TextStroke::get_attribute( 'priceTextStroke', true ),
125 + Icon::get_attribute( 'icon' ),
126 + Typography::get_attribute( 'elementTextTypography', true ),
127 + TextStroke::get_attribute( 'elementTextStroke', true ),
128 + Alignment::get_attribute( 'alignment', true, [ 'value' => 'flex-start' ] ),
129 + Alignment::get_attribute( 'titleAlignment', true, [ 'value' => 'left' ] ),
130 + Alignment::get_attribute( 'descriptionAlignment', true, [ 'value' => 'left' ] ),
131 + Alignment::get_attribute( 'priceAlignment', true, [ 'value' => 'left' ] ),
132 + GroupButton::get_attribute( 'itemsDirection', true, [
133 + 'value' => 'row'
134 + ] ),
135 + Border::get_attribute( 'itemBorder', true ),
136 + Dimensions::get_attribute( 'itemPadding', true ),
137 + Range::get_attribute( [
138 + 'attributeName' => 'columnGap',
139 + 'attributeObjectKey' => 'value',
140 + 'isResponsive' => true,
141 + 'defaultValue' => 20,
142 + 'defaultValueTablet' => 20,
143 + 'defaultValueMobile' => 10,
144 + 'hasUnit' => true,
145 + 'unitDefaultValue' => 'px',
146 + ] ),
147 + Range::get_attribute( [
148 + 'attributeName' => 'width',
149 + 'attributeObjectKey' => 'value',
150 + 'isResponsive' => true,
151 + 'defaultValue' => 100,
152 + 'defaultValueMobile' => '',
153 + 'defaultValueTablet' => '',
154 + 'hasUnit' => true,
155 + 'unitDefaultValue' => '',
156 + ] ),
157 + Range::get_attribute( [
158 + 'attributeName' => 'weight',
159 + 'isResponsive' => false,
160 + 'defaultValue' => 2,
161 + ] ),
162 + Range::get_attribute( [
163 + 'attributeName' => 'size',
164 + 'isResponsive' => false,
165 + 'defaultValue' => 20,
166 + ] ),
167 + Range::get_attribute( [
168 + 'attributeName' => 'gap',
169 + 'attributeObjectKey' => 'value',
170 + 'isResponsive' => true,
171 + 'defaultValue' => 10,
172 + 'defaultValueMobile' => 3,
173 + 'defaultValueTablet' => 1,
174 + 'hasUnit' => true,
175 + 'unitDefaultValue' => 'px',
176 + ] ),
177 + Range::get_attribute( [
178 + 'attributeName' => 'titlePriceGap',
179 + 'attributeObjectKey' => 'value',
180 + 'isResponsive' => true,
181 + 'defaultValue' => '',
182 + 'hasUnit' => true,
183 + 'unitDefaultValue' => 'px',
184 + ] ),
185 +);
186 +
187 +return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
188 +