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

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