• We are using a cookie manager (Real Cookie Banner) and WP Popups on our website.

    When a user visits our site for the first time, he is presented with the Real Cookie Banner popup first, while the WP Popups popup sits in the background. Unfortunately, when the user confirms one of the options in the cookie manager, this does not only close the Real Cookie Banner popup, but the WP Popups popup as well. In other words: All new website visitors will never see the WP Popups popup!

    How can we solve this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Damian

    (@timersys)

    Hi Martin,

    The issue is that the popup is built to detect clicks outside of it and if someone clicks outside of the popup it will close it.

    That behaviour can be canceled in the premium version, so the popup always remains open unless the user clicks on a desired button inside the popup.

    You could add some javascript code to instruct the popup not to close if the click is made on certain class. Do you know the class of the buttons or cookie box that shouldn’t close “our popup” ?

    Thread Starter Martin Sauter

    (@martinsauter)

    The cookie manager contains many buttons and links. The class of that container changes dynamically, but it’s always a <dialog> element that I could target, if that is what we are looking for.

    Plugin Author Damian

    (@timersys)

    You will have to play with it, but the code should be this and it’s using jquery $target.is() function so you need pass a selector

    add_action('wp_footer', function(){

    ?><script>

    window.wp.hooks.addFilter('wppopups_disable_click_out_classes', 'wppopups', function (classes) {

    return classes + ',#your-selector';

    });</script>

    <?php });
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.