PluginProbe
Highlighting Code Block / 2.2.0
Highlighting Code Block v2.2.0
2.2.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.4.0 All 41 releases
highlighting-code-block / highlighting-code-block.php

highlighting-code-block.php in Highlighting Code Block 2.2.0, at highlighting-code-block.php

58 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Highlighting Code Block
4 * Plugin URI: https://wordpress.org/plugins/highlighting-code-block/
5 * Description: Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)
6 * Version: 2.2.0
7 * Requires at least: 5.6
8 * Author: LOOS Inc.
9 * Author URI: https://loos.co.jp/
10 * License: GPL2 or later
11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
12 * Text Domain: highlighting-code-block
13 * Domain Path: /languages
14 */
15
16 if ( ! defined( 'ABSPATH' ) ) exit;
17
18 /**
19 * Defined HCB const.
20 */
21 define( 'LOOS_HCB_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
22 define( 'LOOS_HCB_URL', plugins_url( '', __FILE__ ) );
23
24 // プラグインのバージョン
25 $file_data = get_file_data( __FILE__, [ 'version' => 'Version' ] );
26 if ( ! defined( 'LOOS_HCB_VER' ) ) {
27 define( 'LOOS_HCB_VER', $file_data['version'] );
28 }
29
30 /**
31 * Autoload Class files.
32 */
33 spl_autoload_register( function( $classname ) {
34 if ( false === strpos( $classname, 'LOOS_HCB' ) ) return;
35 $file = LOOS_HCB_PATH . '/class/' . mb_strtolower( $classname ) . '.php';
36 if ( file_exists( $file ) ) require $file;
37 });
38
39 /**
40 * Activation hooks.
41 */
42 register_activation_hook( __FILE__, [ 'LOOS_HCB_Activation', 'plugin_activate' ] );
43 register_uninstall_hook( __FILE__, [ 'LOOS_HCB_Activation', 'plugin_uninstall' ] );
44
45 /**
46 * 翻訳ファイルの読み込み
47 */
48 add_action( 'init', function() {
49 load_plugin_textdomain( 'highlighting-code-block' );
50 }, 0);
51
52 /**
53 * Start
54 */
55 add_action( 'plugins_loaded', function() {
56 new LOOS_HCB();
57 });
58