PluginProbe
Highlighting Code Block / 1.2.6
Highlighting Code Block v1.2.6
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 1.2.6, at highlighting-code-block.php

51 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: 1.2.6
7 * Author: LOOS, Inc.
8 * Author URI: https://loos-web-studio.com/
9 * License: GPL2 or later
10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11 * Text Domain: loos-hcb
12 */
13 if ( ! defined( 'ABSPATH' ) ) exit;
14 if ( ! function_exists( 'register_block_type' ) ) return;
15
16 /**
17 * Defined HCB const.
18 */
19 define( 'LOOS_HCB_VERSION', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? date('mdGis') : '1.2.6');
20 define( 'LOOS_HCB_PATH', plugin_dir_path( __FILE__ ) );
21 define( 'LOOS_HCB_BASENAME', plugin_basename( __FILE__ ) );
22 define( 'LOOS_HCB_URL', plugins_url( '/', __FILE__ ) );
23
24 /**
25 * Autoload Class files.
26 */
27 spl_autoload_register( function( $classname ) {
28
29 if ( false === strpos( $classname, 'LOOS_HCB' ) ) return;
30 $file = LOOS_HCB_PATH .'class/'. mb_strtolower( $classname ) .'.php';
31 if ( file_exists( $file ) ) require $file;
32 });
33
34 /**
35 * Activation hooks.
36 */
37 register_activation_hook( __FILE__, ['LOOS_HCB_Activation', 'plugin_activate'] );
38 register_uninstall_hook( __FILE__, ['LOOS_HCB_Activation', 'plugin_uninstall'] );
39
40 /**
41 * Start
42 */
43 add_action( 'plugins_loaded', function() {
44 // 翻訳
45 $locale = apply_filters( 'plugin_locale', determine_locale(), 'loos-hcb' );
46 load_textdomain( 'loos-hcb', LOOS_HCB_PATH . 'languages/loos-hcb-' . $locale . '.mo' );
47
48 // 実行
49 new LOOS_HCB();
50 });
51