1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
Plugin Name: Tabify Edit Screen |
4
|
|
|
Description: Enables tabs in the edit screen and manage them from the back-end |
5
|
|
|
Version: 1.0.0 |
6
|
|
|
|
7
|
|
|
Plugin URI: https://codekitchen.eu/products/tabify-edit-screen/ |
8
|
|
|
|
9
|
|
|
Author: CodeKitchen B.V. |
10
|
|
|
Author URI: https://codekitchen.eu |
11
|
|
|
Donate link: https://codekitchen.eu/donate |
12
|
|
|
|
13
|
|
|
Text Domain: tabify-edit-screen |
14
|
|
|
Domain Path: /languages |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
/* Copyright 2013-2016 Tabify Edit Screen (email : [email protected]) |
18
|
|
|
|
19
|
|
|
This program is free software; you can redistribute it and/or modify |
20
|
|
|
it under the terms of the GNU General Public License, version 2, as |
21
|
|
|
published by the Free Software Foundation. |
22
|
|
|
|
23
|
|
|
This program is distributed in the hope that it will be useful, |
24
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
25
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26
|
|
|
GNU General Public License for more details. |
27
|
|
|
|
28
|
|
|
You should have received a copy of the GNU General Public License |
29
|
|
|
along with this program; if not, write to the Free Software |
30
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
class Tabify_Edit_Screen { |
34
|
|
|
|
35
|
|
|
public $version = '1.0.0'; |
36
|
|
|
|
37
|
|
|
private $loaded_features = array(); |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Construct method to add hooks when on the admin side |
41
|
|
|
* |
42
|
|
|
* @since 0.1.0 |
43
|
|
|
*/ |
44
|
|
|
public function __construct() { |
45
|
|
|
if ( is_admin() ) { |
46
|
|
|
add_action( 'plugins_loaded', array( $this, 'load' ) ); |
47
|
|
|
add_action( 'plugins_loaded', array( $this, 'load_translation' ) ); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Load functionality |
54
|
|
|
* |
55
|
|
|
* @since 0.9.0 |
56
|
|
|
*/ |
57
|
|
|
public function load() { |
58
|
|
|
include 'inc/edit-screen.php'; |
59
|
|
|
include 'inc/settings-page.php'; |
60
|
|
|
|
61
|
|
|
new Tabify_Edit_Screen_Edit_Screen(); |
62
|
|
|
new Tabify_Edit_Screen_Settings_Page(); |
63
|
|
|
|
64
|
|
|
add_action( 'admin_init', array( $this, 'load_features' ), 1 ); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Load Translations |
69
|
|
|
* |
70
|
|
|
* @since 0.4.0 |
71
|
|
|
*/ |
72
|
|
|
public function load_translation() { |
73
|
|
|
load_plugin_textdomain( 'tabify-edit-screen', false, basename( dirname( __FILE__ ) ) . '/languages' ); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Load features |
78
|
|
|
* |
79
|
|
|
* @since 0.9.0 |
80
|
|
|
*/ |
81
|
|
|
public function load_features() { |
82
|
|
|
$features = array( |
83
|
|
|
'detection', |
84
|
|
|
'permissions' |
85
|
|
|
); |
86
|
|
|
|
87
|
|
|
if ( apply_filters( 'tabify_plugin_support', false ) ) { |
88
|
|
|
$features[] = 'plugin-support'; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
foreach ( $features as $feature ) { |
92
|
|
|
$this->loaded_features[] = $feature; |
93
|
|
|
|
94
|
|
|
$class_name = 'Tabify_Edit_Screen_Feature_' . str_replace( '-', '_', $feature ); |
95
|
|
|
|
96
|
|
|
include 'features/' . $feature . '/' . $feature . '.php'; |
97
|
|
|
new $class_name; |
98
|
|
|
} |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
$GLOBALS['tabify_edit_screen'] = new Tabify_Edit_Screen(); |