-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtabify-edit-screen.php
103 lines (80 loc) · 2.46 KB
/
tabify-edit-screen.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
<?php
/*
Plugin Name: Tabify Edit Screen
Description: Enables tabs in the edit screen and manage them from the back-end
Version: 1.0.0
Plugin URI: https://codekitchen.eu/products/tabify-edit-screen/
Author: CodeKitchen B.V.
Author URI: https://codekitchen.eu
Donate link: https://codekitchen.eu/donate
Text Domain: tabify-edit-screen
Domain Path: /languages
*/
/* Copyright 2013-2016 Tabify Edit Screen (email : info@markoheijnen.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Tabify_Edit_Screen {
public $version = '1.0.0';
private $loaded_features = array();
/**
* Construct method to add hooks when on the admin side
*
* @since 0.1.0
*/
public function __construct() {
if ( is_admin() ) {
add_action( 'plugins_loaded', array( $this, 'load' ) );
add_action( 'plugins_loaded', array( $this, 'load_translation' ) );
}
}
/**
* Load functionality
*
* @since 0.9.0
*/
public function load() {
include 'inc/edit-screen.php';
include 'inc/settings-page.php';
new Tabify_Edit_Screen_Edit_Screen();
new Tabify_Edit_Screen_Settings_Page();
add_action( 'admin_init', array( $this, 'load_features' ), 1 );
}
/**
* Load Translations
*
* @since 0.4.0
*/
public function load_translation() {
load_plugin_textdomain( 'tabify-edit-screen', false, basename( dirname( __FILE__ ) ) . '/languages' );
}
/**
* Load features
*
* @since 0.9.0
*/
public function load_features() {
$features = array(
'detection',
'permissions'
);
if ( apply_filters( 'tabify_plugin_support', false ) ) {
$features[] = 'plugin-support';
}
foreach ( $features as $feature ) {
$this->loaded_features[] = $feature;
$class_name = 'Tabify_Edit_Screen_Feature_' . str_replace( '-', '_', $feature );
include 'features/' . $feature . '/' . $feature . '.php';
new $class_name;
}
}
}
$GLOBALS['tabify_edit_screen'] = new Tabify_Edit_Screen();