Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('after_setup_theme', function () {
- // Define the URLs where Borlabs Cookie should be loaded
- $urlList = [
- '/pathA/',
- '/pathB/onlySubPath/',
- '/kontakt/',
- ];
- if (!class_exists('\Borlabs\Cookie\Container\ApplicationContainer')) {
- return;
- }
- $shouldRemoveAction = true;
- foreach ($urlList as $url) {
- if (strpos($_SERVER['REQUEST_URI'], $url) !== false) {
- $shouldRemoveAction = false;
- break;
- }
- }
- if ($shouldRemoveAction) {
- return;
- }
- $container = \Borlabs\Cookie\Container\ApplicationContainer::get();
- remove_action('init', [$container->get(\Borlabs\Cookie\System\WordPressFrontendDriver\WordPressFrontendInit::class), 'register']);
- });
Add Comment
Please, Sign In to add comment