[wp-trac] [WordPress Trac] #8783: Plugin Delete - Allow hook similiar to register_activation_hook for when a Plugin is Deleted via Plugin Admin

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 2 19:41:32 GMT 2009


#8783: Plugin Delete - Allow hook similiar to register_activation_hook for when a
Plugin is Deleted via Plugin Admin
-------------------------+--------------------------------------------------
 Reporter:  sc0ttkclark  |       Owner:                      
     Type:  enhancement  |      Status:  new                 
 Priority:  normal       |   Milestone:  2.8                 
Component:  Plugins      |     Version:                      
 Severity:  normal       |    Keywords:  plugins,delete,clean
-------------------------+--------------------------------------------------
 There could be a function similar to
 {{{
 register_activation_hook( __FILE__, 'myplugin_activate' );
 }}}
 which could look like this
 {{{
 register_delete_hook( __FILE__, 'myplugin_delete' );
 }}}
 So that when you delete a plugin from the Plugin Admin interface, it will
 check the plugin's main file for that hook, if found it will run that
 function. The purpose of this would be to allow the plugin to cleanup
 data.

 '''An optional prompt should be used on the delete screens to ask the user
 if they want to clear the plugin's "data" (only if the delete hook is
 found for the plugin). That would be most optimal.'''

 Right now the only option is to go through that plugin, us the 'reset'
 function or something similar, deactivate, and then delete the plugin. It
 seems more logical to have a built-in wordpress hook that could call the
 plugin's delete function to remove the data.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8783>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list