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/menu-item/attributes.php +30 -0 2.9.1 → 2.16.0 View file →
@@ -1,6 +1,13 @@
1 1 <?php
2 +
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + exit;
5 +}
6 +
2 7 use ABlocks\Controls\Link;
8 +use ABlocks\Controls\Icon;
9 +use ABlocks\Controls\Range;
3 10 $attributes = [
4 11 'block_id' => [
5 12 'type' => 'string',
6 13 'default' => '',
@@ -24,8 +31,16 @@
24 31 'link' => [
25 32 'type' => 'string',
26 33 'default' => '#',
27 34 ],
35 + 'showIcon' => [
36 + 'type' => 'boolean',
37 + 'default' => false,
38 + ],
39 + 'iconPosition' => [
40 + 'type' => 'string',
41 + 'default' => 'left',
42 + ],
28 43 ];
29 44
30 45 $attributes = array_merge(
31 46 $attributes,
@@ -30,7 +45,22 @@
30 45 $attributes = array_merge(
31 46 $attributes,
32 47 // Adding attributes from various controls
33 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 + ]),
34 64 );
35 65
36 66 return $attributes;