PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.6
Kubio AI Page Builder v2.8.6
2.9.0 2.8.6 2.8.5 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 / social-icons / index.php
kubio / build / block-library / blocks / social-icons Last commit date
blocks 3 years ago block.json 4 years ago index.php 1 year ago
index.php
65 lines
1 <?php
2
3 namespace Kubio\Blocks;
4
5 use IlluminateAgnostic\Arr\Support\Arr;
6 use Kubio\Core\Blocks\BlockBase;
7 use Kubio\Core\Registry;
8 use Kubio\Core\Utils;
9
10
11 class SocialIconsBlock extends BlockBase {
12 const OUTER = 'outer';
13
14 public function __construct( $block, $autoload = true ) {
15 parent::__construct( $block, $autoload );
16 }
17
18 public function mapPropsToElements() {
19 return array(
20 self::OUTER => array(),
21 );
22 }
23 }
24
25 Registry::registerBlock( __DIR__, SocialIconsBlock::class );
26
27 class SocialIconBlock extends BlockBase {
28 const LINK = 'link';
29 const ICON = 'icon';
30
31 public function mapPropsToElements() {
32 $link = $this->getAttribute( 'link' );
33 $link_attributes = Utils::getLinkAttributes( $link );
34
35 $icon_name = $this->getAttribute( 'icon.name' );
36
37 return array(
38 self::LINK => array_merge(
39 $link_attributes,
40 array(
41 'aria-label' => esc_attr(
42 sprintf(
43 // translators: %s: social link value
44 __( 'Social link: %s', 'kubio' ),
45 Arr::get( $link, 'value', '' )
46 )
47 ),
48 )
49 ),
50
51 self::ICON => array(
52 'name' => $icon_name,
53 ),
54 );
55 }
56 }
57
58 Registry::registerBlock(
59 __DIR__,
60 SocialIconBlock::class,
61 array(
62 'metadata' => './blocks/social-icon/block.json',
63 )
64 );
65