Bypass when using URL parameters
-
I need to allow a bypass page to by bypassed even when a variable URL parameter exists in the URL string.
For instance I have this code:// Allow all single posts if ( is_single() ) { $bypass = true; } // Allow these absolute URLs $allowed = array( home_url( '/my-account/' ), home_url( '/commissary-login/' ), home_url( '/storehouse-registration-page/' ), ); if ( ! $bypass ) { $bypass = in_array( $visited_url, $allowed ); } return $bypass; } add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 2 ); /** * Sets Custom Registration and Login Page */ add_filter( 'register_url', 'custom_register_url' ); function custom_register_url( $register_url ) { $register_url = home_url( '/storehouse-registration-page/' ); return $register_url; }
It allows access to my custom registration page when accessed directly. Such as: https://domain.com/storehouse-registration-page/
However, I need it also to allow access if a URL parameter is being used such as a UTM code or other parameters that are needed for the registration form to capture in a hidden field. Such as:
https://domain.com/storehouse-registration-page/?registration-source=Google
or
https://domain.com/storehouse-registration-page/?registration-source=Facebook
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bypass when using URL parameters’ is closed to new replies.