I’ve just realized that the traditional uninstall.php
file along a plugin is not working in Multisite.
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
exit();
delete_option( 'plugin_option_name' );
This doesn’t delete the sub-sites options in all wp_SITE-ID_options
tables.
Is there a standard way for doing this?
Searching inside all
uninstall.php
files that I have in my hard-drive, I’ve found two that had the functionis_multisite()
: User Role Editor and Add Code to Head.Both use a
$wpdb
loop. Simplified:Related Q&A: Uninstall, Activate, Deactivate a plugin: typical features & how-to