[wp-trac] [WordPress Trac] #30673: plugin uninstall.php not called when multisite site is deleted

WordPress Trac noreply at wordpress.org
Mon Dec 7 17:42:39 UTC 2015


#30673: plugin uninstall.php not called when multisite site is deleted
--------------------------------+------------------------------
 Reporter:  dpik                |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Networks and Sites  |     Version:  4.0.1
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  multisite
--------------------------------+------------------------------

Comment (by RMarks):

 I propose the following code:

 {{{
 add_action( 'delete_blog', 'deactivate_blogs_plugins');

 function deactivate_blogs_plugins() {
     $active_plugins = get_option('active_plugins');
     foreach( $active_plugins as $key => $value) {
         $plugin_directory = explode('/',$value); // Folder name will be
 displayed
         deactivate_plugins( plugin_basename( $plugin_directory ), false,
 false );
     }
 }
 }}}

 I tested this with Easy Digital Downloads which creates a
 `wp_#_edd_comments` table.  When I deactivate the plugin, the additional
 table is present.  I don't think my code above will help correct this.

 Any suggestions?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30673#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list