-
Notifications
You must be signed in to change notification settings - Fork 0
/
translationexchange-api.php
73 lines (59 loc) · 2.9 KB
/
translationexchange-api.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
<?php
/*
Plugin Name: Translation Exchange API
Plugin URI: http://wordpress.org/plugins/translationexchange-api/
Description: Translation Exchange API for WordPress.
Author: Translation Exchange, Inc
Version: 0.1.4
Author URI: https://translationexchange.com/
License: GPLv2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
*/
/*
Copyright (c) 2017 Translation Exchange, Inc. https://translationexchange.com
_______ _ _ _ ______ _
|__ __| | | | | (_) | ____| | |
| |_ __ __ _ _ __ ___| | __ _| |_ _ ___ _ __ | |__ __ _____| |__ __ _ _ __ __ _ ___
| | '__/ _` | '_ \/ __| |/ _` | __| |/ _ \| '_ \| __| \ \/ / __| '_ \ / _` | '_ \ / _` |/ _ \
| | | | (_| | | | \__ \ | (_| | |_| | (_) | | | | |____ > < (__| | | | (_| | | | | (_| | __/
|_|_| \__,_|_| |_|___/_|\__,_|\__|_|\___/|_| |_|______/_/\_\___|_| |_|\__,_|_| |_|\__, |\___|
__/ |
|___/
GNU General Public License, version 2
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.
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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
http://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('ABSPATH')) exit;
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
require_once(dirname(__FILE__) . '/src/strategies/default_strategy.php');
require_once(dirname(__FILE__) . '/src/strategies/polylang_strategy.php');
require_once(dirname(__FILE__) . '/src/strategies/wpml_strategy.php');
global $trex_api_strategy;
global $disable_webhooks;
/**
* Init Plugin
*/
function trex_api_init_plugin()
{
global $trex_api_strategy;
if (is_plugin_active('sitepress-multilingual-cms/sitepress.php')) {
$trex_api_strategy = new WpmlStrategy();
} else if (is_plugin_active('polylang/polylang.php')) {
$trex_api_strategy = new PolylangStrategy();
} else {
$trex_api_strategy = new DefaultStrategy();
}
}
add_action('plugins_loaded', 'trex_api_init_plugin', 2);
include_once(dirname(__FILE__) . '/src/basic_auth.php');
include_once(dirname(__FILE__) . '/src/api.php');
include_once(dirname(__FILE__) . '/src/routes.php');