WordPress.org

Ready to get started?Download WordPress

Forums

How to deactivate my plugin upon deactivation of NextGen (1 post)

  1. Iperdesign_IT
    Member
    Posted 2 years ago #

    Hi guys, 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.

Topic Closed

This topic has been closed to new replies.

About this Topic