PluginProbe
Counters Block – showcase your stats with animated numbers / 2.0.6
Counters Block – showcase your stats with animated numbers v2.0.6
2.0.8 2.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6
counters-block / counters-block.php

counters-block.php in Counters Block – showcase your stats with animated numbers 2.0.6, at counters-block.php

37 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
4 if (!class_exists('CTRBPBlock')) {
5 class CTRBPBlock
6 {
7 function __construct()
8 {
9 add_action('enqueue_block_assets', [$this, 'enqueueBlockAssets']);
10 add_action('init', [$this, 'onInit']);
11 }
12
13 function enqueueBlockAssets()
14 {
15 wp_register_style('font-awesome-7', CTRB_DIR_URL . 'public/css/font-awesome.min.css', [], '7.1.0');
16 wp_enqueue_style('font-awesome-7');
17
18 $handle = 'ctrb-inline-premium';
19 wp_register_script($handle, false, [], CTRB_VERSION, true);
20 $data = [
21 'isPremium' => function_exists('ctrbIsPremium') ? ctrbIsPremium() : false,
22 'hasPro' => defined('CTRB_HAS_PRO') ? CTRB_HAS_PRO : false,
23 'version' => defined('CTRB_VERSION') ? CTRB_VERSION : '',
24 ];
25 $inline = 'window.ctrbPremiumProps = Object.assign(window.ctrbPremiumProps || {}, ' . wp_json_encode($data) . ');';
26 wp_add_inline_script($handle, $inline, 'before');
27 wp_enqueue_script($handle);
28 }
29
30 function onInit()
31 {
32 register_block_type(__DIR__ . '/build');
33 }
34 }
35 new CTRBPBlock();
36 }
37