Skip to content

Commit

Permalink
Add Metronet plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Aug 28, 2024
1 parent 383e73e commit 478319d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mu-plugins/metronet-tag-manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* Plugin Name: Metronet Tag Manager settings
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
*/

add_filter('option_metronet_tag_manager', static function ($value) {
// Read CookieYes cookie
if (!isset($_COOKIE['cookieyes-consent'])) {
return false;
}

return in_array('analytics:yes', explode(',', $_COOKIE['cookieyes-consent']), true)
? $value
: false;
}, 20, 1);

0 comments on commit 478319d

Please sign in to comment.