i'm writing this plugin and i need to deactivate it when NextGen is deactivated:
<?php
/*
Plugin Name: Plugin Name
Description: Description
Version: 1.0
Author: Author
Author URI: Author URI
*/
// ini_set( "display_errors", 0);
global $nextgenUrl;
$nextgenUrl = str_replace('/','\\',WP_PLUGIN_DIR.'nextgen-gallery\nggallery.php');
register_deactivation_hook( $nextgenUrl , 'disattiva' );
[... other code ...]
function disattiva(){
deactivate_plugins(__FILE__);
}
but it doesn't work. Any idea? :(
I've also used these urls:
$nextgenUrl = 'nextgen-gallery\nggallery.php';
$nextgenUrl = '/nextgen-gallery/nggallery.php';
and still it doesn't work.