PluginProbe
Chart Block – Visualize Data with Bar, Line, Pie Charts / 1.1.9
Chart Block – Visualize Data with Bar, Line, Pie Charts v1.1.9
1.2.0 1.1.9 1.1.8 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7
chart-block / chart-block.php

chart-block.php in Chart Block – Visualize Data with Bar, Line, Pie Charts 1.1.9, at chart-block.php

29 lines 944 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( !defined( 'ABSPATH' ) ) { exit; }
4
5 if( !class_exists( 'ChartBlock_Plugin' ) ){
6 class ChartBlock_Plugin {
7 function __construct(){
8 add_action( 'init', [$this, 'chart_block_onInit'] );
9 add_action( 'enqueue_block_assets', [$this, 'chart_block_enqueueBlockAssets'] );
10 add_action( 'enqueue_block_editor_assets', [$this, 'chart_block_enqueueBlockEditorAssets'] );
11 }
12
13 function chart_block_enqueueBlockAssets(){
14 wp_register_script( 'chartJS', CHART_BLOCK_DIR_URL . 'assets/js/chart.min.js', [], '3.5.1', true );
15 }
16 function chart_block_enqueueBlockEditorAssets(){
17 wp_add_inline_script( 'wp-data', sprintf(
18 'const chart_block_pricing_url = %s;',
19 wp_json_encode( admin_url( 'edit.php?post_type=chart_block&page=block-dashboard#/pricing' ) )
20 ), 'before' );
21 }
22
23
24 function chart_block_onInit() {
25 register_block_type( __DIR__ . '/build' );
26 }
27 }
28 new ChartBlock_Plugin();
29 }