[wp-trac] [WordPress Trac] #40821: Add filter to `wpmu_delete_blog()` to overwrite ability to drop tables

WordPress Trac noreply at wordpress.org
Fri May 19 20:45:25 UTC 2017

#40821: Add filter to `wpmu_delete_blog()` to overwrite ability to drop tables
 Reporter:  mermel              |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Future Release
Component:  Networks and Sites  |     Version:  trunk
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  multisite

Comment (by mermel):

 Replying to [comment:2 flixos90]:
 > I'm curious about a use-case for this. When would you want to deny
 dropping tables even though it is set? I'm not opposed to the filter, but
 would like to get some background.

 We have environments that we prevent certain queries, like those
 containing `DROP TABLE..` to run.  However we do still run the core tests
 in these environments.  A few of the tests that run under `multisite` use
 `wpmu_delete_blog( x, true )`.  Similarly with the deletion of the uploads
 directory, we would prefer to handle the cleanup of those files explicitly
 rather than risks the test unintentionally deleting customer data.

 An example can be found here:

 This filter would prevent us from having to modify core files in our
 implementation only, therefore simplifying merges going forward.

 Good point on the filter name, I agree it should be changed too :)

Ticket URL: <https://core.trac.wordpress.org/ticket/40821#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list