PluginProbe
Highlighting Code Block / 2.2.1
Highlighting Code Block v2.2.1
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.1, at highlighting-code-block.php

59 lines 1.6 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.1
7 * Requires at least: 5.6
8 * Requires PHP: 5.6
9 * Author: LOOS Inc.
10 * Author URI: https://loos.co.jp/
11 * License: GPLv2 or later
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 * Text Domain: highlighting-code-block
14 * Domain Path: /languages
15 */
16
17 if ( ! defined( 'ABSPATH' ) ) exit;
18
19 /**
20 * Defined HCB const.
21 */
22 define( 'LOOS_HCB_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
23 define( 'LOOS_HCB_URL', plugins_url( '', __FILE__ ) );
24
25 // プラグインのバージョン
26 $file_data = get_file_data( __FILE__, [ 'version' => 'Version' ] );
27 if ( ! defined( 'LOOS_HCB_VER' ) ) {
28 define( 'LOOS_HCB_VER', $file_data['version'] );
29 }
30
31 /**
32 * Autoload Class files.
33 */
34 spl_autoload_register( function( $classname ) {
35 if ( false === strpos( $classname, 'LOOS_HCB' ) ) return;
36 $file = LOOS_HCB_PATH . '/class/' . mb_strtolower( $classname ) . '.php';
37 if ( file_exists( $file ) ) require $file;
38 });
39
40 /**
41 * Activation hooks.
42 */
43 register_activation_hook( __FILE__, [ 'LOOS_HCB_Activation', 'plugin_activate' ] );
44 register_uninstall_hook( __FILE__, [ 'LOOS_HCB_Activation', 'plugin_uninstall' ] );
45
46 /**
47 * 翻訳ファイルの読み込み
48 */
49 add_action( 'init', function() {
50 load_plugin_textdomain( 'highlighting-code-block' );
51 }, 0);
52
53 /**
54 * Start
55 */
56 add_action( 'plugins_loaded', function() {
57 new LOOS_HCB();
58 });
59