PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.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 / star-ratings / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at includes/blocks/star-ratings/attributes.php

88 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ABlocks\Blocks\StarRatings;
3
4 use ABlocks\Controls\Alignment;
5 use ABlocks\Controls\Range;
6 use ABlocks\Controls\Typography;
7 use ABlocks\Helper;
8 use ABlocks\Controls\Icon;
9
10 $attributes = [
11 'block_id' => [
12 'type' => 'string',
13 'default' => '',
14 ],
15 'scale' => [
16 'type' => 'number',
17 'default' => 5,
18 ],
19 'ratingColor' => [
20 'type' => 'string',
21 'default' => '#e99516',
22 ],
23 'ratingUnmarkedColor' => [
24 'type' => 'string',
25 'default' => '#696969'
26 ],
27 'showCount' => [
28 'type' => 'boolean',
29 'default' => true,
30 ],
31 'showRatingNumber' => [
32 'type' => 'boolean',
33 'default' => true,
34 ],
35 'ratingNumberColor' => [
36 'type' => 'string',
37 'default' => '#000000',
38 ],
39 'ratingNumberPosition' => [
40 'type' => 'string',
41 'default' => 'right',
42 ],
43
44 ];
45
46 $attributes = array_merge(
47 $attributes,
48 Range::get_attribute( [
49 'attributeName' => 'rating',
50 'isResponsive' => false,
51 'defaultValue' => 4,
52 ]),
53 Range::get_attribute( [
54 'attributeName' => 'size',
55 'attributeObjectKey' => 'value',
56 'isResponsive' => true,
57 'defaultValue' => 24,
58 'hasUnit' => true,
59 'unitDefaultValue' => 'px',
60 ]),
61 Range::get_attribute( [
62 'attributeName' => 'spacing',
63 'attributeObjectKey' => 'value',
64 'isResponsive' => true,
65 'defaultValue' => 0,
66 'hasUnit' => true,
67 'unitDefaultValue' => 'px',
68 ] ),
69 Range::get_attribute( [
70 'attributeName' => 'ratingNumberGap',
71 'attributeObjectKey' => 'value',
72 'isResponsive' => true,
73 'defaultValue' => 0,
74 'hasUnit' => true,
75 'unitDefaultValue' => 'px',
76 ] ),
77 Typography::get_attribute( 'ratingNumberTypography', true ),
78 Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
79 Icon::get_attribute('icon', [
80 'path' => 'M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z',
81 'viewBox' => '0 0 576 512',
82 'className' => 'far fa-star',
83 ] ),
84 );
85
86 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
87
88