• Resolved N496

    (@n496)


    Hello, I am trying to create a popup where the user has to agree with the displayed terms and conditions before being able to use the website. Is there a way to close the popup when the user clicks on the call to action (I agree) button? I tried going through the support forum but I couldn’t find any solution for this. Thanks in advance for your time.

    https://www.ads-software.com/plugins/wordpress-popup/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey there N496,

    How are you doing today?

    This can’t be done out of a box with the current version of the plugin. I’ve found the same question asked on our forum where my colleague offered custom solution for this. Please see the following:

    https://premium.wpmudev.org/forums/topic/i-want-the-call-to-action-button-to-close-the-pop-up-how#post-973224

    Hope this helps ??

    Cheers,
    Bojan

    Thread Starter N496

    (@n496)

    Hey Bojan, thanks for the quick answer.
    I managed to solve the issue in another way, by removing the CTA button, adding “Never see this message again” link, and changing the text with this function I found on some other topic (added to functions.php):

    function change_translate_text( $translated_text ) {
    	if ( $translated_text == 'Never see this message again.' ) {
    		$translated_text = 'I agree with the terms';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    Then I styled the text a bit to make it look like a button. It seems to be working fine. I hope this can be useful for other people.
    Btw, your plugin is great!

    Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey again,

    That’s definitely one way of doing it, thank you for posting the solution for the sake of other members ??

    Just to add, changing that text is also possible by using plugin translation files but the above should definitely work too.

    Btw, your plugin is great!

    Glad to hear that you like it! If you’re willing and when you have time we’d really appreciate if you could write a review and rate the plugin.

    Happy holidays!

    Cheers,
    Bojan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Close popup on button click’ is closed to new replies.