forked from justcoded/just-tinymce-custom-styles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjust-tiny-mce-styles.php
76 lines (66 loc) · 1.86 KB
/
just-tiny-mce-styles.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
<?php
/*
Plugin Name: Just TinyMCE Custom Styles
Description: Adds dropdown options for custom css classes and attributes for tags in WordPress TinyMCE Editor
Tags: tinymce, editor, link class, custom styles, styles, tag class, link attributes, tag attributes, custom editor
Version: 1.2
Author: JustCoded / Alex Prokopenko
Author URI: http://justcoded.com/
License: GPL2
*/
define('JTMCE_ROOT', dirname(__FILE__));
require_once( JTMCE_ROOT . '/core/helpers.php' );
require_once( JTMCE_ROOT . '/core/Autoload.php' );
use jtmce\core;
use jtmce\components;
use jtmce\controllers;
class JustTinyMceStyles extends core\Singleton
{
/**
* Textual plugin name
*
* @var string
*/
public static $pluginName;
/**
* Current plugin version
*
* @var float
*/
public static $version;
/**
* Plugin text domain for translations
*/
const TEXTDOMAIN = 'just-tiny-mce-styles';
/**
* Plugin main entry point
*
* protected constructor prevents creating another plugin instance with "new" operator
*/
protected function __construct()
{
// init plugin name and version
self::$pluginName = __('Just TinyMCE Custom Styles', JustTinyMceStyles::TEXTDOMAIN);
self::$version = 1.2;
// init features, which this plugin is created for
if ( !is_admin() ) return;
new components\TinyMceExt();
new controllers\FormatsController();
new controllers\SettingsController();
new controllers\PresetsController();
}
/**
* Checks WordPress version to be greater or equal to the control point
*
* @global string $wp_version method uses global WP var
* @param string $control_version version to compare with
*
* @return boolean true if WordPress version meets the requirements
*/
public static function wpVersion( $control_version )
{
global $wp_version;
return ( version_compare($wp_version, $control_version) >= 0 );
}
}
JustTinyMceStyles::run();