generated from KevinBatdorf/gutenberg-rust-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
code-block-pro.php
36 lines (32 loc) · 1.32 KB
/
code-block-pro.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Plugin Name: Code Block Pro
* Description: Code highlighting powered by the VS Code engine
* Plugin URI: https://code-block-pro.com/?utm_campaign=plugin&utm_source=plugin-uri
* Author: Kevin Batdorf
* Author URI: https://code-block-pro.com/?utm_campaign=plugin&utm_source=author-uri
* Requires at least: 6.0
* Requires PHP: 7.0
* Version: 1.26.6
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: code-block-pro
*
* @package kevinbatdorf
*/
defined('ABSPATH') or die;
add_action('init', function () {
register_block_type(__DIR__ . '/build');
wp_set_script_translations('kevinbatdorf/code-block-pro', 'code-block-pro');
wp_add_inline_script('kevinbatdorf-code-block-pro-view-script', 'window.codeBlockPro = ' . wp_json_encode([
'pluginUrl' => esc_url_raw(plugin_dir_url(__FILE__)),
]) . ';');
});
add_action('admin_init', function () {
wp_add_inline_script('kevinbatdorf-code-block-pro-editor-script', 'window.codeBlockPro = ' . wp_json_encode([
'pluginUrl' => esc_url_raw(plugin_dir_url(__FILE__)),
]) . ';');
});
include_once(__DIR__ . '/php/compatibility.php');
include_once(__DIR__ . '/php/router.php');
include_once(__DIR__ . '/php/routes.php');