• Hi, i’m writing a plugin that uses his own table in the database. I want that, when the plugin is deactivated from the plugins list, the database is kept. Besides, i have add a button to the plugin options page to uninstall it properley, droping all tables. But I cannot find how to make my plugin deactivate himslef after that. I thought that would work, but it doesn’t:

    $this->aixorder_deactivate(); //droping my tables (works, tested)
    $plugin = plugin_basename(__FILE__);
     do_action('deactivate_'.$plugin); //plugin is not deactivated, and i land on my plugins options page full of errors because my database table was dropped...
Viewing 1 replies (of 1 total)
  • Thread Starter primo411

    (@primo411)

    Well, I have a beginning answer… I misunderstood the do_action function: it justs creates a new hook. What i search is how to force the deactivation of the plugin and land on the plugin list.

Viewing 1 replies (of 1 total)
  • The topic ‘Self-deactivate plugin ?’ is closed to new replies.