yoast_wpseo_self_deactivate

The method will deactivate the plugin, but only once, done by the static $is_deactivated.

Description

yoast_wpseo_self_deactivate(); 

Usage

  1. if ( !function_exists( 'yoast_wpseo_self_deactivate' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/wp-seo-main.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = yoast_wpseo_self_deactivate(); 
  7.  

Defined (1)

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

/wp-seo-main.php  
  1. function yoast_wpseo_self_deactivate() { 
  2. static $is_deactivated; 
  3.  
  4. if ( $is_deactivated === null ) { 
  5. $is_deactivated = true; 
  6. deactivate_plugins( plugin_basename( WPSEO_FILE ) ); 
  7. if ( isset( $_GET['activate'] ) ) { 
  8. unset( $_GET['activate'] );