-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevolution-code-highlight.php
More file actions
36 lines (31 loc) · 1.14 KB
/
Copy pathevolution-code-highlight.php
File metadata and controls
36 lines (31 loc) · 1.14 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
<?php
/*
* Plugin Name: Highlight.js for Evolution
* Description: Plugin to highlight code in your posts. Uses a custom build of highlight.js.
* Version: 1.1
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Matheus Misumoto
* Author URI: https://matheusmisumoto.dev/
* License: GPL v3 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'HIGHLIGHT_VERSION', '1.1' );
if ( ! function_exists( 'run_code_highlight' ) ) {
function run_code_highlight(){
wp_enqueue_style( 'highlight', plugin_dir_url( __FILE__ ) . 'highlightjs.css', array(), '11.9.0', 'all' );
wp_enqueue_script( 'highlight', plugin_dir_url( __FILE__ ) . 'highlight.min.js', array(), '11.9.0');
wp_add_inline_script('highlight', 'hljs.highlightAll();');
}
}
add_action('wp_enqueue_scripts', 'run_code_highlight');
?>