You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jQuery(document).ready(function($){varconsentCategory=$("#example-plugin-content").data("consentcategory");console.log("checking consent for category "+consentCategory);console.log("load plugin example");document.addEventListener("wp_listen_for_consent_change",function(e){console.log("listen for consent events");varchangedConsentCategory=e.detail;console.log(changedConsentCategory);for(varkeyinchangedConsentCategory){if(changedConsentCategory.hasOwnProperty(key)){if(key===consentCategory&&changedConsentCategory[key]==="allow"){console.log("set "+consentCategory+" cookie on user actions");activateConsent()}}}});$(document).on("wp_consent_type_defined",activateMyCookies);functionactivateMyCookies(consentData){if(wp_has_consent(consentCategory)){console.log("do "+consentCategory+" cookie stuff")}else{console.log("no "+consentCategory+" cookies please")}}if(!window.waitfor_consent_hook){console.log("we don't have to wait for the consent type, we can check the consent level right away!");if(wp_has_consent(consentCategory)){activateConsent();console.log("set "+consentCategory+" stuff now!")}else{console.log("No "+consentCategory+" stuff please!")}}functionactivateConsent(){console.log("fire "+consentCategory);$("#example-plugin-content .functional-content").hide();$("#example-plugin-content .marketing-content").show()}});