yit_deactive_free_version

The YITH WooCommerce Compare yit deactive free version function.

Description

yit_deactive_free_version( $to_deactive, $to_active ); 

Parameters (2)

0. $to_deactive
The to deactive.
1. $to_active
The to active.

Usage

  1. if ( !function_exists( 'yit_deactive_free_version' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-compare/plugin-fw/yit-deactive-plugin.php'; 
  3.  
  4. // The to deactive. 
  5. $to_deactive = null; 
  6.  
  7. // The to active. 
  8. $to_active = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = yit_deactive_free_version($to_deactive, $to_active); 
  12.  

Defined (1)

The function is defined in the following location(s).

/plugin-fw/yit-deactive-plugin.php  
  1. function yit_deactive_free_version( $to_deactive, $to_active ) { 
  2.  
  3. if ( ! function_exists( 'is_plugin_active' ) ) { 
  4. require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  5.  
  6. if ( defined( $to_deactive ) && is_plugin_active( constant( $to_deactive ) ) ) { 
  7. deactivate_plugins( constant( $to_deactive ) ); 
  8.  
  9. if( ! function_exists( 'wp_create_nonce' ) ) { 
  10. header( 'Location: plugins.php'); 
  11. exit(); 
  12.  
  13.  
  14. global $status, $page, $s; 
  15. $redirect = 'plugins.php?action=activate&plugin=' . $to_active . '&plugin_status=' . $status . '&paged=' . $page . '&s=' . $s; 
  16. $redirect = esc_url_raw( add_query_arg( '_wpnonce', wp_create_nonce( 'activate-plugin_' . $to_active ), $redirect ) ); 
  17.  
  18. header( 'Location: ' . $redirect ); 
  19. exit();