PluginProbe
Polylang / 2.6.4
Polylang v2.6.4
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / polylang.php

polylang.php in Polylang 2.6.4, at polylang.php

77 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 Plugin Name: Polylang
5 Plugin URI: https://polylang.pro
6 Version: 2.6.4
7 Author: WP SYNTEX
8 Author uri: https://polylang.pro
9 Description: Adds multilingual capability to WordPress
10 Text Domain: polylang
11 Domain Path: /languages
12 */
13
14 /*
15 * Copyright 2011-2019 Frédéric Demarle
16 * Copyright 2019 WP SYNTEX
17 *
18 * This program is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
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, see <https://www.gnu.org/licenses/>.
30 */
31
32 if ( ! defined( 'ABSPATH' ) ) {
33 exit; // don't access directly
34 };
35
36 if ( defined( 'POLYLANG_BASENAME' ) ) {
37 // The user is attempting to activate a second plugin instance, typically Polylang and Polylang Pro
38 require_once ABSPATH . 'wp-admin/includes/plugin.php';
39 if ( defined( 'POLYLANG_PRO' ) ) {
40 // Polylang Pro is already activated
41 if ( is_plugin_active( plugin_basename( __FILE__ ) ) ) {
42 require_once ABSPATH . 'wp-includes/pluggable.php';
43 deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate this plugin
44 // WP does not allow us to send a custom meaningful message, so just tell the plugin has been deactivated
45 wp_safe_redirect( add_query_arg( 'deactivate', 'true', remove_query_arg( 'activate' ) ) );
46 exit;
47 }
48 } else {
49 // Polylang was activated, deactivate it to keep only what we expect to be Polylang Pro
50 deactivate_plugins( POLYLANG_BASENAME );
51 }
52 } else {
53 // Go on loading the plugin
54 define( 'POLYLANG_VERSION', '2.6.4' );
55 define( 'PLL_MIN_WP_VERSION', '4.7' );
56
57 define( 'POLYLANG_FILE', __FILE__ ); // this file
58 define( 'POLYLANG_BASENAME', plugin_basename( POLYLANG_FILE ) ); // plugin name as known by WP
59 define( 'POLYLANG_DIR', dirname( POLYLANG_FILE ) ); // our directory
60 define( 'POLYLANG', ucwords( str_replace( '-', ' ', dirname( POLYLANG_BASENAME ) ) ) );
61
62 define( 'PLL_ADMIN_INC', POLYLANG_DIR . '/admin' );
63 define( 'PLL_FRONT_INC', POLYLANG_DIR . '/frontend' );
64 define( 'PLL_INC', POLYLANG_DIR . '/include' );
65 define( 'PLL_INSTALL_INC', POLYLANG_DIR . '/install' );
66 define( 'PLL_MODULES_INC', POLYLANG_DIR . '/modules' );
67 define( 'PLL_SETTINGS_INC', POLYLANG_DIR . '/settings' );
68 define( 'PLL_PREFIX', 'pll_' );
69
70 if ( file_exists( PLL_MODULES_INC . '/pro.php' ) ) {
71 define( 'POLYLANG_PRO', true );
72 }
73
74 require_once PLL_INC . '/class-polylang.php';
75 new Polylang();
76 }
77