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
ablocks / includes / blocks / price-menu-item / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.16.0, at includes/blocks/price-menu-item/attributes.php

161 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use ABlocks\Controls\Alignment;
4 use ABlocks\Controls\Range;
5 use ABlocks\Controls\Typography;
6 use ABlocks\Controls\GroupButton;
7 use ABlocks\Controls\TextShadow;
8 use ABlocks\Controls\TextStroke;
9 use ABlocks\Controls\Icon;
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 $attributes = [
15 'block_id' => [
16 'type' => 'string',
17 'default' => '',
18 ],
19 'device' => [
20 'type' => 'string',
21 'default' => '',
22 ],
23 'allowIcon' => [
24 'type' => 'boolean',
25 'default' => true,
26 ],
27 'allowDescription' => [
28 'type' => 'boolean',
29 'default' => true,
30 ],
31 'allowDivider' => [
32 'type' => 'boolean',
33 'default' => true,
34 ],
35 'title' => [
36 'type' => 'string',
37 'default' => 'Sushi Roll...',
38 ],
39 'titleTag' => [
40 'type' => 'string',
41 'default' => 'p',
42 ],
43 'titleColor' => [
44 'type' => 'string',
45 'default' => '',
46 ],
47 'description' => [
48 'type' => 'string',
49 'source' => 'html',
50 'selector' => '.ablocks-price-menu-item-details-des',
51 'default' => 'Lorem ipsum dolor sit amet consectetur adipiscing, elit praesent. Sed do eiusmod tempor incididunt aliqua.',
52 ],
53 'descriptionTag' => [
54 'type' => 'string',
55 'default' => 'p',
56 ],
57 'descriptionColor' => [
58 'type' => 'string',
59 'default' => '',
60 ],
61 // divider related attributes
62 'placeDivider' => [
63 'type' => [ 'string', 'object' ],
64 'default' => 'near title',
65 ],
66 'dividerPatternUrl' => [
67 'type' => 'string',
68 'default' => '',
69 ],
70 'dividerType' => [
71 'type' => 'string',
72 'default' => '',
73 ],
74 'color' => [
75 'type' => 'string',
76 'default' => '',
77 ],
78 'price' => [
79 'type' => 'string',
80 'source' => 'html',
81 'selector' => '.ablocks-price-menu-item-price',
82 'default' => '$15.00',
83 ],
84 'placePrice' => [
85 'type' => [ 'string', 'object' ],
86 'default' => 'right',
87 ],
88 'priceTag' => [
89 'type' => 'string',
90 'default' => 'p',
91 ],
92 'priceColor' => [
93 'type' => 'string',
94 'default' => '',
95 ],
96 'priceAlignmentCustom' => [
97 'type' => 'boolean',
98 'default' => false,
99 ],
100 ];
101
102 $attributes = array_merge(
103 $attributes,
104 Typography::get_attribute( 'titleTypography', true ),
105 TextShadow::get_attribute( 'titleTextShadow' ),
106 TextStroke::get_attribute( 'titleTextStroke', true ),
107 Typography::get_attribute( 'descriptionTypography', true ),
108 TextShadow::get_attribute( 'descriptionTextShadow' ),
109 TextStroke::get_attribute( 'descriptionTextStroke', true ),
110 Typography::get_attribute( 'priceTypography', true ),
111 TextShadow::get_attribute( 'priceTextShadow' ),
112 TextStroke::get_attribute( 'priceTextStroke', true ),
113 Icon::get_attribute( 'icon', [
114 'size' => '40',
115 'iconType' => 'stacked',
116 'iconShape' => 'square',
117 ] ),
118 Typography::get_attribute( 'elementTextTypography', true ),
119 TextStroke::get_attribute( 'elementTextStroke', true ),
120 Alignment::get_attribute( 'alignment', true, [ 'value' => '' ] ),
121 Alignment::get_attribute( 'titleAlignment', true, [ 'value' => '' ] ),
122 Alignment::get_attribute( 'descriptionAlignment', true, [ 'value' => '' ] ),
123 Alignment::get_attribute( 'priceAlignment', true, [ 'value' => '' ] ),
124 GroupButton::get_attribute( 'itemsDirection', true, [
125 'value' => 'row',
126 ] ),
127 Range::get_attribute( [
128 'attributeName' => 'width',
129 'attributeObjectKey' => 'value',
130 'isResponsive' => true,
131 'defaultValue' => null,
132 'defaultValueMobile' => null,
133 'defaultValueTablet' => null,
134 'hasUnit' => true,
135 'unitDefaultValue' => '',
136 ] ),
137 Range::get_attribute( [
138 'attributeName' => 'weight',
139 'isResponsive' => false,
140 'defaultValue' => null,
141 ] ),
142 Range::get_attribute( [
143 'attributeName' => 'size',
144 'isResponsive' => false,
145 'defaultValue' => null,
146 ] ),
147 Range::get_attribute( [
148 'attributeName' => 'gap',
149 'attributeObjectKey' => 'value',
150 'isResponsive' => true,
151 'defaultValue' => 10,
152 'defaultValueMobile' => 3,
153 'defaultValueTablet' => 1,
154 'hasUnit' => true,
155 'unitDefaultValue' => 'px',
156 ] ),
157 );
158
159 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
160
161