-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebberzone-code-block-highlighting.php
More file actions
96 lines (87 loc) · 2.32 KB
/
webberzone-code-block-highlighting.php
File metadata and controls
96 lines (87 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* WebberZone Code Block Highlighting.
*
* Extends the Gutenberg Code block with syntax highlighting powered by Prism.js.
*
* @package WebberZone\Code_Block_Highlighting
* @author Ajay D'Souza
* @license GPL-2.0+
* @link https://webberzone.com
* @copyright 2024 Ajay D'Souza
*
* @wordpress-plugin
* Plugin Name: WebberZone Code Block Highlighting
* Plugin URI: https://github.com/WebberZone/webberzone-code-block-highlighting
* Description: Extends the Gutenberg Code block with syntax highlighting powered by Prism.js.
* Version: 1.0.0-RC1
* Author: WebberZone
* Author URI: https://webberzone.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: webberzone-code-block-highlighting
* Domain Path: /languages
*/
namespace WebberZone\Code_Block_Highlighting;
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Holds the version of WebberZone Code Block Highlighting.
*
* @since 1.0.0
*/
if ( ! defined( 'WZ_CBH_VERSION' ) ) {
define( 'WZ_CBH_VERSION', '1.0.0' );
}
/**
* Holds the full path to the plugin file.
*
* @since 1.0.0
*/
if ( ! defined( 'WZ_CBH_PLUGIN_FILE' ) ) {
define( 'WZ_CBH_PLUGIN_FILE', __FILE__ );
}
/**
* Holds the filesystem directory path (with trailing slash) for WebberZone Code Block Highlighting.
*
* @since 1.0.0
*/
if ( ! defined( 'WZ_CBH_PLUGIN_DIR' ) ) {
define( 'WZ_CBH_PLUGIN_DIR', plugin_dir_path( WZ_CBH_PLUGIN_FILE ) );
}
/**
* Holds the URL (with trailing slash) for WebberZone Code Block Highlighting.
*
* @since 1.0.0
*/
if ( ! defined( 'WZ_CBH_PLUGIN_URL' ) ) {
define( 'WZ_CBH_PLUGIN_URL', plugin_dir_url( WZ_CBH_PLUGIN_FILE ) );
}
// Load custom autoloader.
if ( ! function_exists( __NAMESPACE__ . '\autoload' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'includes/autoloader.php';
}
if ( ! function_exists( __NAMESPACE__ . '\wz_cbh' ) ) {
/**
* Returns the instance of the WebberZone Code Block Highlighting main class.
*
* @since 1.0.0
*
* @return \WebberZone\Code_Block_Highlighting\Main
*/
function wz_cbh() {
return \WebberZone\Code_Block_Highlighting\Main::get_instance();
}
}
if ( ! function_exists( __NAMESPACE__ . '\load' ) ) {
/**
* Loads the plugin.
*
* @since 1.0.0
*/
function load(): void {
wz_cbh();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
}