forked from TaxoPress/TaxoPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple-tags.php
139 lines (112 loc) · 4.07 KB
/
simple-tags.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/**
* Plugin Name: TaxoPress
* Plugin URI: https://wordpress.org/plugins/simple-tags/
* Description: TaxoPress allows you to create and manage Tags, Categories, and all your WordPress taxonomy terms.
* Version: 3.21.0
* Author: TaxoPress
* Author URI: https://taxopress.com
* Text Domain: simple-tags
* Domain Path: /languages
* Min WP Version: 4.9.7
* Requires PHP: 5.6
* License: GPLv3
*
* Copyright (c) 2022 Taxopress
*
* @package simple-tags
* @author TaxoPress
* @copyright Copyright (C) 2007, 2011 Darren Ethier; modifications Copyright (C) 2022 TaxoPress
* @license GNU General Public License version 2
* @link https://taxoPress.com/
*/
######################################
/*
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; either version 2 of the License, or
(at your option) any later version.
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.
Contributors to the TaxoPress code include:
- Kevin Drouvin ([email protected] - http://inside-dev.net)
- Martin Modler ([email protected] - http://www.webformatik.com)
- Vladimir Kolesnikov ([email protected] - http://blog.sjinks.pro)
Sections of the TaxoPress code are based on Custom Post Type UI by WebDevStudios.
Credits Icons :
- famfamfam - http://www.famfamfam.com/lab/icons/silk/
*/
// don't load directly
if (!defined('ABSPATH')) {
die('-1');
}
if (!defined('STAGS_VERSION')) {
define('STAGS_VERSION', '3.21.0');
}
$pro_active = false;
foreach ((array)get_option('active_plugins') as $plugin_file) {
if (false !== strpos($plugin_file, 'taxopress-pro.php')) {
$pro_active = true;
break;
}
}
if (!$pro_active && is_multisite()) {
foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) {
if (false !== strpos($plugin_file, 'taxopress-pro.php')) {
$pro_active = true;
break;
}
}
}
if ($pro_active) {
add_filter(
'plugin_row_meta',
function($links, $file)
{
if ($file == plugin_basename(__FILE__)) {
$links[]= __('<strong>This plugin can be deleted.</strong>', 'simple-tags');
}
return $links;
},
10, 2
);
}
if (defined('TAXOPRESS_FILE') || $pro_active) {
if(!function_exists('deactivate_plugins')){
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
//deactivate current plugin if pro is active
deactivate_plugins( plugin_basename( __FILE__ ) );
return;
}
define ( 'TAXOPRESS_FILE', __FILE__ );
define('STAGS_MIN_PHP_VERSION', '7.2.5');
define('STAGS_OPTIONS_NAME', 'simpletags'); // Option name for save settings
define('STAGS_OPTIONS_NAME_AUTO', 'simpletags-auto'); // Option name for save settings auto terms
define('STAGS_URL', plugins_url('', __FILE__));
define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/'));
define('TAXOPRESS_ABSPATH', __DIR__);
// Check PHP min version
if (version_compare(PHP_VERSION, STAGS_MIN_PHP_VERSION, '<')) {
require STAGS_DIR . '/inc/class.compatibility.php';
// possibly display a notice, trigger error
add_action('admin_init', array('SimpleTags_Compatibility', 'admin_init'));
// stop execution of this file
return;
}
require STAGS_DIR . '/inc/loads.php';
// Init TaxoPress
function init_free_simple_tags()
{
if (is_admin() && !defined('TAXOPRESS_PRO_VERSION')) {
require_once(TAXOPRESS_ABSPATH . '/includes-core/TaxopressCoreAdmin.php');
new \PublishPress\Taxopress\TaxopressCoreAdmin();
}
}
add_action('plugins_loaded', 'init_free_simple_tags');
// Activation, uninstall
register_activation_hook(__FILE__, array('SimpleTags_Plugin', 'activation'));
register_deactivation_hook(__FILE__, array('SimpleTags_Plugin', 'deactivation'));
add_action('plugins_loaded', 'init_simple_tags');