PluginProbe ʕ •ᴥ•ʔ
Syntax-highlighting Code Block (with Server-side Rendering) / 1.5.2
Syntax-highlighting Code Block (with Server-side Rendering) v1.5.2
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.4.0 1.5.0 1.5.1 1.5.2
syntax-highlighting-code-block / syntax-highlighting-code-block.php
syntax-highlighting-code-block Last commit date
build 1 month ago inc 1 month ago vendor 1 month ago LICENSE 6 years ago editor-styles.css 3 years ago language-names.php 5 years ago readme.txt 1 month ago style.css 3 years ago syntax-highlighting-code-block.php 1 month ago uninstall.php 2 years ago
syntax-highlighting-code-block.php
78 lines
1 <?php
2 /**
3 * Plugin Name: Syntax-highlighting Code Block (with Server-side Rendering)
4 * Plugin URI: https://github.com/westonruter/syntax-highlighting-code-block
5 * Description: Extending the Code block with syntax highlighting rendered on the server, thus being AMP-compatible and having faster frontend performance.
6 * Requires at least: 6.6
7 * Requires PHP: 7.4
8 * Version: 1.5.2
9 * Author: Weston Ruter
10 * Author URI: https://weston.ruter.net/
11 * License: GPL2
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 * Text Domain: syntax-highlighting-code-block
14 *
15 * @package Syntax_Highlighting_Code_Block
16 */
17
18 namespace Syntax_Highlighting_Code_Block;
19
20 if ( ! defined( 'ABSPATH' ) ) {
21 exit; // Exit if accessed directly.
22 }
23
24 const PLUGIN_VERSION = '1.5.2';
25
26 const PLUGIN_MAIN_FILE = __FILE__;
27
28 const PLUGIN_DIR = __DIR__;
29
30 const BLOCK_NAME = 'core/code';
31
32 const DEVELOPMENT_MODE = false;
33
34 const OPTION_NAME = 'syntax_highlighting';
35
36 const DEFAULT_THEME = 'default';
37
38 const DEFAULT_HIGHLIGHTED_COLOR = '#ddf6ff';
39
40 const BLOCK_STYLE_FILTER = 'syntax_highlighting_code_block_style';
41
42 const HIGHLIGHTED_LINE_BACKGROUND_COLOR_FILTER = 'syntax_highlighted_line_background_color';
43
44 const THEME_STYLE_HANDLE = 'syntax-highlighting-code-block-theme';
45
46 const BLOCK_STYLE_HANDLE = 'syntax-highlighting-code-block';
47
48 const STYLE_HANDLES = [ THEME_STYLE_HANDLE, BLOCK_STYLE_HANDLE ];
49
50 const REST_API_NAMESPACE = 'syntax-highlighting-code-block/v1';
51
52 const EDITOR_SCRIPT_HANDLE = 'syntax-highlighting-code-block-scripts';
53
54 const EDITOR_STYLE_HANDLE = 'syntax-highlighting-code-block-styles';
55
56 const ATTRIBUTE_SCHEMA = [
57 'language' => [
58 'type' => 'string',
59 'default' => '',
60 ],
61 'highlightedLines' => [
62 'type' => 'string',
63 'default' => '',
64 ],
65 'showLineNumbers' => [
66 'type' => 'boolean',
67 'default' => false,
68 ],
69 'wrapLines' => [
70 'type' => 'boolean',
71 'default' => false,
72 ],
73 ];
74
75 require_once __DIR__ . '/inc/functions.php';
76
77 add_action( 'plugins_loaded', __NAMESPACE__ . '\boot' );
78