Make sure we also disable WooCommerce Admin on a multi site

This commit is contained in:
Lourens Schep 2022-05-12 10:06:25 -03:00
parent 4992899d84
commit 7d23a2b7c8
1 changed files with 4 additions and 2 deletions

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(