PopUp Pro - Approximate URL REGEX

Hi,

I am using the PopUp Pro plugin, and I am trying to have the pop-up show on a specific URL with parameters included, except if there is a parameter "skip=true";

For example, I want the pop up to work on the following urls:
https://www.domain.com/start-form/
https://www.domain.com/start-form/?name=value&city=value
https://www.domain.com/start-form/?param=value&etc=value

I don't want the PopUp to work if there is a "skip=true" in the parameter:
https://www.domain.com/start-form/?name=value&skip=true
https://www.domain.com/start-form/?skip=true
https://www.domain.com/start-form/?skip=true&param=value

I know I can use the "On Approximate URL", and "Not On Approximate URL", but I cannot use them at the same time.

"On Approximate URL":
https://www.domain.com/start-form/*
This will allow the PopUp to work on all Parameters of the URL,

And if I set "Not On Approximate URL":
skip=true
This will have the PopUp work on all URLs of the entire Site except URLS that contain "skip=true".

However, the Plugin won't let me use "On Approximate URL" and "Not On Approximate URL" at the same time. One or the other option will be grayed out.

Can you help me show the PopUp on a this specific URL with parameters included, except if there is a parameter "skip=true"?

Thank You in Advance

  • Tyler Postle

    Hey Alex,

    I think this would require more complex regex to work as you want. I'm going to flag one of our SLS staff(coding experts) to have a look and see if they can come up with some regex that will work for you in this case

    Keep in mind since SLS deals with more complex threads it might take them a little longer to reply. In the meantime, let us know if you have any further questions!

    All the best,
    Tyler

  • Jude

    Hey Alex

    Sorry about the extreme delay here, it somehow slipped through the gaps. This can be done with a bit of JS, its a lot easier than modifying core plugin behaviour which needs to be redone on updates.

    <script type="text/javascript">
    $(document).ready(function () {
        if(window.location.href.indexOf("skip=true") > -1) {
           		jQuery( document ).trigger( 'popup-closed', [IncPopup, _options.popup] );
    		// Legacy trigger.
    		jQuery( document ).trigger( 'popover-closed', [IncPopup, _options.popup] );
        }
    });
    </script>

    Let us know if you still need help with this. Keeping my eyes open on this thread.

    Thank you for being a WPMU DEV member and have a fantastic day!

    Cheers
    Jude