-
Notifications
You must be signed in to change notification settings - Fork 1
/
vaaky-highlighter.php
120 lines (103 loc) · 2.9 KB
/
vaaky-highlighter.php
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
* Vaaky Highlighter
*
* @since 1.0.0
* @package VaakyHighlighter
*
* @wordpress-plugin
* Plugin Name: Vaaky Highlighter
* Plugin URI: https://wordpress.org/plugin/vaaky-highlighter
* Description: Simple yet elegant syntax or code highlighter based on highlight.js. It allows you to add engaging snippet code blocks.
* Version: 1.0.6
* Author: Raunak Gupta
* Author URI: https://www.webhat.in/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: vaaky-highlighter
* Domain Path: /Languages
* Requires PHP: 5.6
*/
namespace VaakyHighlighter;
use VaakyHighlighter\Includes\Activator;
use VaakyHighlighter\Includes\Deactivator;
use VaakyHighlighter\Includes\Main;
// If this file is called directly, abort.
if (!defined('ABSPATH'))
{
exit();
}
// Autoloader
require_once plugin_dir_path(__FILE__) . 'Autoloader.php';
/**
* Current plugin version.
*/
define('VAAKY_HIGHLIGHTER_VERSION', '1.0.6');
/**
* The string used to uniquely identify this plugin.
*/
define('VAAKY_HIGHLIGHTER_SLUG', 'vaaky-highlighter');
/**
* plugin dir path
*/
define('VAAKY_HIGHLIGHTER_PLUGIN_PATH', dirname(__FILE__));
/**
* plugin dir base path
*/
define('VAAKY_HIGHLIGHTER_PLUGIN_BASENAME', plugin_basename(__FILE__));
/**
* highlightjs version
* @link: https://github.com/highlightjs/highlight.js/releases
*/
define('VAAKY_HIGHLIGHTER_HLJS_VERSION', '11.2.0');
/**
* Configuration data
* - db-version: Start with 0 and increment by 1. It should not be updated with every plugin update,
* only when database update is required.
*/
$configuration = array(
'version' => VAAKY_HIGHLIGHTER_VERSION,
'db-version' => 0
);
/**
* The ID for the configuration options in the database.
*/
$configurationOptionName = VAAKY_HIGHLIGHTER_SLUG . '-configuration';
/**
* The code that runs during plugin activation.
* This action is documented in Includes/Activator.php
*/
register_activation_hook(__FILE__, function($networkWide) use($configuration, $configurationOptionName)
{
Activator::activate($networkWide, $configuration, $configurationOptionName);
});
/**
* Run the activation code when a new site is created.
*/
add_action('wpmu_new_blog', function($blogId)
{
Activator::activateNewSite($blogId);
});
/**
* The code that runs during plugin deactivation.
* This action is documented in Includes/Deactivator.php
*/
register_deactivation_hook(__FILE__, function($networkWide)
{
Deactivator::deactivate($networkWide);
});
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks
* kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function vaakyHighlighterStart()
{
$plugin = new Main();
$plugin->run();
}
vaakyHighlighterStart();