Support » Plugin: Complianz - GDPR/CCPA Cookie Consent » filter cmplz_site_needs_cookiewarning not working

  • Resolved apostolism

    (@apostolism)


    Hi there,

    I need to disable the cookie banner in specific pages and I use the “cmplz_site_needs_cookiewarning” filter to accomplish this, unfortunately without success.

    I have added the code mentioned on the page https://complianz.io/excluding-pages-from-the-cookie-banner/ but it does not work.

    For testing, I have used the below code but still, the banner works normally:

    function my_filter_site_needs_cookiewarning($cookiewarning_required){
    	return false;
    }
    
    add_filter('cmplz_site_needs_cookiewarning', 'my_filter_site_needs_cookiewarning', 99 );

    The code has been used in both functions.php of theme and as a mu-plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @apostolism,

    Your code works fine for me. Where have you added this code?

    Thread Starter apostolism

    (@apostolism)

    Hi @rogierlankhorst,

    First of all, thank you for this exceptional plugin and your quick response. When you mentioned earlier that my code works, you made me look for it more.

    At first, I added the code in functions.php of my theme but to no luck. When I added the code as a mu-plugin and after I cleaned thoroughly the cache, it successfully ran.

    The reason is the firing sequence of WordPress hooks, plugins run before theme so my filter (in functions.php) was not applied in time. But as a mu-plugin instead, it runs before normal plugins, and before your plugin’s function site_needs_cookie_warning.

    • This reply was modified 1 year, 10 months ago by apostolism.
    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Great, thanks for the detailed update!

    Plugin Contributor Mathieu

    (@paapst)

    Hi @apostolism

    Great to hear that your issue is resolved! Could you tell us what you think of the plugin or the support by casting your Review here? We’d love to hear your feedback!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘filter cmplz_site_needs_cookiewarning not working’ is closed to new replies.