Last active
October 14, 2022 07:30
-
-
Save alewolf/60fb98454411ddab32bcb502ac7e000b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* 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