Skip to content

Instantly share code, notes, and snippets.

@alewolf
Last active October 14, 2022 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alewolf/60fb98454411ddab32bcb502ac7e000b to your computer and use it in GitHub Desktop.
Save alewolf/60fb98454411ddab32bcb502ac7e000b to your computer and use it in GitHub Desktop.
<?php
/**
* This mu plugin deactivates the Pixel Manager
* while the Thrive Theme editor is active.
*
* Create a file disable-pmw-on-thrive-editor.php.
* Place it in the /mu-plugins/ folder within the /wp-content/ folder.
* If the /mu-plugins/ folder doesn't exist yet, it must be manually created.
*/
$unique_uri_pattern = 'action=architect';
if(strpos($_SERVER['REQUEST_URI'], $unique_uri_pattern) !== false){
add_filter('option_active_plugins', function ($plugins) {
$plugin_paths = [
'woocommerce-google-adwords-conversion-tracking-tag/wgact.php',
'woopt-pixel-manager-pro/wgact.php',
'woocommerce-pixel-manager/woocommerce-pixel-manager.php',
'woocommerce-pixel-manager-pro/wgact.php',
];
foreach ($plugin_paths as $key => $plugin) {
if (in_array($plugin, $plugins)) {
$pos = array_search($plugin, $plugins);
unset($plugins[$pos]);
}
}
return $plugins;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment