forked from maximeschoeni/sublanguage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsublanguage.php
More file actions
79 lines (48 loc) · 2.11 KB
/
sublanguage.php
File metadata and controls
79 lines (48 loc) · 2.11 KB
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
<?php
/*
Plugin Name: Sublanguage
Plugin URI: http://sublanguageplugin.wordpress.com
Description: Plugin for building a site with multiple languages
Author: Maxime Schoeni
Version: 2.5
Author URI: http://sublanguageplugin.wordpress.com
Text Domain: sublanguage
Domain Path: /languages
License: GPL
Copyright 2015 Maxime Schoeni <contact@maximeschoeni.ch>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2.
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, see <http://www.gnu.org/licenses/>.
*/
require( plugin_dir_path( __FILE__ ) . 'class-core.php');
require( plugin_dir_path( __FILE__ ) . 'class-current.php');
require( plugin_dir_path( __FILE__ ) . 'class-rewrite.php');
if (is_admin()) {
global $sublanguage_admin;
require( plugin_dir_path( __FILE__ ) . 'class-admin.php');
if (defined('DOING_AJAX') && DOING_AJAX) {
require( plugin_dir_path( __FILE__ ) . 'class-ajax.php');
$sublanguage_admin = new Sublanguage_ajax();
} else {
require( plugin_dir_path( __FILE__ ) . 'class-admin-ui.php');
$sublanguage_admin = new Sublanguage_admin_ui();
}
register_activation_hook(__FILE__, array($sublanguage_admin, 'activate'));
register_deactivation_hook(__FILE__, array($sublanguage_admin, 'desactivate'));
} else {
$options_v2 = get_option('sublanguage');
if (!$options_v2 || empty($options_v2['version']) || version_compare($options_v2['version'], '2.0') < 0 || empty($options_v2['db_version']) || version_compare($options_v2['db_version'], '2.0') < 0) {
// run compat
require( plugin_dir_path( __FILE__ ) . 'compat/sublanguage.php');
} else {
global $sublanguage;
require( plugin_dir_path( __FILE__ ) . 'class-site.php');
$sublanguage = new Sublanguage_site();
}
}