assets
5 years ago
bin
5 years ago
languages
5 years ago
lib
5 years ago
templates
5 years ago
.jshintrc
6 years ago
Gruntfile.js
5 years ago
init.php
5 years ago
package.json
5 years ago
yit-deactive-plugin.php
9 years ago
yit-functions.php
5 years ago
yit-plugin-registration-hook.php
8 years ago
yit-plugin.php
5 years ago
yit-woocommerce-compatibility.php
8 years ago
yit-deactive-plugin.php
35 lines
| 1 | <?php |
| 2 | /* |
| 3 | * This file belongs to the YIT Framework. |
| 4 | * |
| 5 | * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) |
| 6 | * that is bundled with this package in the file LICENSE.txt. |
| 7 | * It is also available through the world-wide-web at this URL: |
| 8 | * http://www.gnu.org/licenses/gpl-3.0.txt |
| 9 | */ |
| 10 | |
| 11 | if ( ! function_exists( 'yit_deactive_free_version' ) ) { |
| 12 | function yit_deactive_free_version( $to_deactive, $to_active ) { |
| 13 | |
| 14 | if ( ! function_exists( 'is_plugin_active' ) ) { |
| 15 | require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 16 | } |
| 17 | |
| 18 | if ( defined( $to_deactive ) && is_plugin_active( constant( $to_deactive ) ) ) { |
| 19 | deactivate_plugins( constant( $to_deactive ) ); |
| 20 | |
| 21 | if( ! function_exists( 'wp_create_nonce' ) ){ |
| 22 | header( 'Location: plugins.php'); |
| 23 | exit(); |
| 24 | } |
| 25 | |
| 26 | |
| 27 | global $status, $page, $s; |
| 28 | $redirect = 'plugins.php?action=activate&plugin=' . $to_active . '&plugin_status=' . $status . '&paged=' . $page . '&s=' . $s; |
| 29 | $redirect = esc_url_raw( add_query_arg( '_wpnonce', wp_create_nonce( 'activate-plugin_' . $to_active ), $redirect ) ); |
| 30 | |
| 31 | header( 'Location: ' . $redirect ); |
| 32 | exit(); |
| 33 | } |
| 34 | } |
| 35 | } |