Skip to:
Content
Pages
Categories
Search
Top
Bottom

on plugin deactivation…

  • Hi,

    There is a hook so that, on plugin deactivation, you can do an action. In my case, I want to drop a table when the plugin is deactivated.

    I can’t seem to get it to work. What am I missing?

    The code:

    function bb_deactivate_bbmenu() {
    bb_register_deactivation_hook( bbmenu.php, 'drop_bbmenu_table' );
    }

    do_action( 'bb_deactivate_bbmenu' . $plugin );

    function drop_bbmenu_table() {
    global $bbdb;

    $query = "DROP TABLE <code>$bbdb->menu</code>";

    $bbdb->query( $query );
    }

    Also where does $plugin come from? Do I need to set it or does it grab the plugin’s name? And same about __file__ I used the plugins php file for this. Is this correct?

    Some help plz

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar