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

57 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.2.9
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 * Domain Path: /languages
13 */
14 if ( ! defined( 'ABSPATH' ) ) exit;
15 if ( ! function_exists( 'register_block_type' ) ) return;
16
17 /**
18 * Defined HCB const.
19 */
20 define( 'LOOS_HCB_VERSION', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? date('mdGis') : '1.2.9');
21 define( 'LOOS_HCB_PATH', plugin_dir_path( __FILE__ ) );
22 define( 'LOOS_HCB_BASENAME', plugin_basename( __FILE__ ) );
23 define( 'LOOS_HCB_URL', plugins_url( '/', __FILE__ ) );
24
25 /**
26 * Autoload Class files.
27 */
28 spl_autoload_register( function( $classname ) {
29
30 if ( false === strpos( $classname, 'LOOS_HCB' ) ) return;
31 $file = LOOS_HCB_PATH .'class/'. mb_strtolower( $classname ) .'.php';
32 if ( file_exists( $file ) ) require $file;
33 });
34
35 /**
36 * Activation hooks.
37 */
38 register_activation_hook( __FILE__, ['LOOS_HCB_Activation', 'plugin_activate'] );
39 register_uninstall_hook( __FILE__, ['LOOS_HCB_Activation', 'plugin_uninstall'] );
40
41 /**
42 * Start
43 */
44 add_action( 'plugins_loaded', function() {
45 // 翻訳
46 // $locale = apply_filters( 'plugin_locale', determine_locale(), 'loos-hcb' );
47 // load_textdomain( 'loos-hcb', LOOS_HCB_PATH . 'languages/loos-hcb-' . $locale . '.mo' );
48 if ( 'ja' === determine_locale() ) {
49 load_textdomain( 'loos-hcb', LOOS_HCB_PATH . 'languages/loos-hcb-ja.mo' );
50 } else {
51 load_plugin_textdomain( 'loos-hcb' );
52 }
53
54 // 実行
55 new LOOS_HCB();
56 });
57