/** * Deactivate All CSP Plugins * * @return NULL Check if it's site or multisite and decativate it. */ public function deactivatePlugin() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { $orig_id = $wpdb->blogid; $blog_id = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blog_id as $id) { if (switch_to_blog($id)) { installerCsp::delete(); } } switch_to_blog($orig_id); return; } else { installerCsp::delete(); } }