Support » Plugin: GDPR Cookie Compliance » How turn off Cookie Info Bar ?

  • Resolved zdzich

    (@hydrax)


    Hi
    How I turn off Cookie Info Bar ? How to turn off . I would like to show the user who visits the page to immediately see the popup with the settings.

Viewing 1 replies (of 1 total)
  • Plugin Author Gaspar Nemes

    (@gasparnemes)

    Hi There,

    You can try to add the following code snippets to your functions.php

    Function to disable the cookie info bar:

    add_action('moove_gdpr_inline_styles','moove_extend_gdpr_styles',10,3);
    function moove_extend_gdpr_styles( $styles, $primary, $secondary ) {
      $styles .= '#moove_gdpr_cookie_info_bar { display: none; }';
      return $styles;
    }

    Function to display the popup if the cookies does NOT exists:

    function gdpr_js_extension() {
        ob_start();
        ?>
        <script>
        	jQuery(document).ready(function(){
        		if ( ! document.cookie.match(/^(.*;)?\s*moove_gdpr_popup\s*=\s*[^;]+(.*)?$/) ) {
        			setTimeout(function(){
        				var modal_instance = lity('#moove_gdpr_cookie_modal');
        			}, 500);
        		}
        	});
        </script>
        <?php
        echo ob_get_clean();
    }
    add_action( 'wp_footer', 'gdpr_js_extension', 1000 );

    I hope this works.

    • This reply was modified 11 months, 3 weeks ago by  Gaspar Nemes.
Viewing 1 replies (of 1 total)
  • The topic ‘How turn off Cookie Info Bar ?’ is closed to new replies.