PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.3
Kubio AI Page Builder v2.8.3
2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / build / block-library / blocks / divider / index.php
kubio / build / block-library / blocks / divider Last commit date
block.json 4 years ago index.php 4 years ago
index.php
45 lines
1 <?php
2
3 namespace Kubio\Blocks;
4
5 use Kubio\Core\Blocks\BlockBase;
6 use Kubio\Core\Registry;
7
8 class DividerBlock extends BlockBase {
9
10 const OUTER = 'outer';
11 const LINE = 'line';
12 const INNER = 'inner';
13
14 public function computed() {
15 $iconEnabled = false;
16 if ( $this->getProp( 'type' ) === 'icon' ) {
17 $iconEnabled = true;
18 }
19 return array(
20 'iconEnabled' => $iconEnabled,
21 );
22 }
23
24 public function mapPropsToElements() {
25 if ( $this->getProp( 'type' ) === 'icon' ) {
26 if ( ! $this->getAttribute( 'iconName' ) ) {
27 $icon = '';
28 } else {
29 $icon = $this->getAttribute( 'iconName' );
30 }
31 } else {
32 $icon = null;
33 }
34 return array(
35 self::INNER => array( 'name' => $icon ),
36 );
37 }
38 }
39
40
41 Registry::registerBlock(
42 __DIR__,
43 DividerBlock::class
44 );
45