[wp-trac] [WordPress Trac] #12754: register_uninstall_hook() doesn't allow multiple callbacks

WordPress Trac wp-trac at lists.automattic.com
Fri May 7 23:00:53 UTC 2010


#12754: register_uninstall_hook() doesn't allow multiple callbacks
-------------------------+--------------------------------------------------
 Reporter:  scribu       |        Owner:  westi     
     Type:  enhancement  |       Status:  closed    
 Priority:  normal       |    Milestone:            
Component:  Plugins      |      Version:  3.0       
 Severity:  normal       |   Resolution:  worksforme
 Keywords:  needs-patch  |  
-------------------------+--------------------------------------------------
Changes (by scribu):

  * status:  new => closed
  * resolution:  => worksforme
  * milestone:  Future Release =>


Comment:

 Anyhow, here's my workaround:

 {{{
 // Have more than one callback attached to the uninstall hook
 function add_uninstall_hook($plugin, $callback) {
         // trigger $is_uninstallable_plugin flag
         register_uninstall_hook($plugin, '__return_false');

         add_action('uninstall_' . plugin_basename($plugin), $callback);
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12754#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list