Last active
December 12, 2023 05:08
-
-
Save mehrshaddarzi/6cee66cb4b189a5cdd577b9a00cd2b54 to your computer and use it in GitHub Desktop.
Disable WordPress plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Activate Plugins | |
*/ | |
add_filter( 'option_active_plugins', function ( $plugins ) { | |
$actual_link = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
if(strtoupper($_SERVER['REQUEST_METHOD']) == "POST" and strpos($actual_link, 'admin-ajax.php') !== false and isset($_POST['action']) and $_POST['action'] == "irk_quick_cart"){ | |
return ['woocommerce/woocommerce.php']; | |
} | |
return $plugins; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment