PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.2
Kubio AI Page Builder v2.8.2
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 / copyright / index.php
kubio / build / block-library / blocks / copyright Last commit date
block.json 1 year ago index.php 1 year ago
index.php
46 lines
1 <?php
2
3 namespace Kubio\Blocks;
4
5 use Kubio\Core\Blocks\BlockBase;
6 use Kubio\Core\Registry;
7
8 class CopyrightBlock extends BlockBase {
9
10 const CONTAINER = 'container';
11 const OUTER = 'outer';
12
13 public function mapPropsToElements() {
14
15 $template = $this->getTemplateValue();
16 return array(
17 self::OUTER => array( 'innerHTML' => $this->render_template( $template ) ),
18 );
19 }
20
21 function getTemplateValue() {
22 $template = $this->getBlockInnerHtml();
23 return $template;
24 }
25
26 function render_template( $content = '' ) {
27 $default = '&copy; {year} {site-name}.';
28 $msg = $content ? $content : $default;
29
30 // replace placeholders with actual values
31 $msg = str_replace( '{year}', gmdate( 'Y' ), $msg );
32 $msg = str_replace( '{site-name}', get_bloginfo( 'name' ), $msg );
33
34 // sanitize the message to allow only post like content
35 $msg = wp_kses_post( $msg );
36
37 $msg = sprintf( '<p>%s</p>', $msg );
38 return html_entity_decode( $msg );
39 }
40 }
41
42 Registry::registerBlock(
43 __DIR__,
44 CopyrightBlock::class
45 );
46