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 / 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/menu-item/attributes.php

67 lines 1.2 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\Link;
8 use ABlocks\Controls\Icon;
9 use ABlocks\Controls\Range;
10 $attributes = [
11 'block_id' => [
12 'type' => 'string',
13 'default' => '',
14 ],
15 'label' => [
16 'type' => 'string',
17 'default' => 'Menu',
18 ],
19 'isSubMenu' => [
20 'type' => 'boolean',
21 'default' => false,
22 ],
23 'hasMegaMenu' => [
24 'type' => 'boolean',
25 'default' => false
26 ],
27 'hasLink' => [
28 'type' => 'boolean',
29 'default' => false,
30 ],
31 'link' => [
32 'type' => 'string',
33 'default' => '#',
34 ],
35 'showIcon' => [
36 'type' => 'boolean',
37 'default' => false,
38 ],
39 'iconPosition' => [
40 'type' => 'string',
41 'default' => 'left',
42 ],
43 ];
44
45 $attributes = array_merge(
46 $attributes,
47 // Adding attributes from various controls
48 Link::get_attribute( 'link' ),
49 // The icon is stored in the block comment: the item's dropdown arrow also
50 // uses `svg.ablocks-svg-icon`, so an HTML-sourced icon would read it back.
51 Icon::get_attribute( 'icon', [
52 'size' => 16,
53 'color' => '',
54 'hasNoSelectorOrSource' => true,
55 ] ),
56 Range::get_attribute([
57 'attributeName' => 'iconSpace',
58 'attributeObjectKey' => 'value',
59 'isResponsive' => true,
60 'defaultValue' => 8,
61 'hasUnit' => true,
62 'unitDefaultValue' => 'px',
63 ]),
64 );
65
66 return $attributes;
67