Merge pull request #32981 from woocommerce/fix/32962_multisite_disable

Make sure we also disable WooCommerce Admin on a multi site
This commit is contained in:
louwie17 2022-05-12 15:59:16 -03:00 committed by GitHub
commit f05d8959c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Make sure WooCommerce Admin is also being disabled on multi sites. #32981

View File

@ -91,11 +91,13 @@ class Loader {
* If WooCommerce Admin is installed and activated, it will attempt to deactivate and show a notice.
*/
public static function deactivate_wc_admin_plugin() {
if ( PluginsHelper::is_plugin_active( 'woocommerce-admin' ) ) {
$plugin_path = PluginsHelper::get_plugin_path_from_slug( 'woocommerce-admin' );
if ( is_plugin_active( $plugin_path ) ) {
$path = PluginsHelper::get_plugin_path_from_slug( 'woocommerce-admin' );
deactivate_plugins( $path );
$notice_action = is_network_admin() ? 'network_admin_notices' : 'admin_notices';
add_action(
'admin_notices',
$notice_action,
function() {
echo '<div class="error"><p>';
printf(