Hi– thanks for using Force Login!
You’ll need to whitelist/bypass the url/page the iframe src= is referencing. Check out the FAQs for details on how to add exceptions for certain pages.
Is this right? The URL would be https://*.celebrantplanner.com.au/gfembed/?f=2
where the * would be the subdomain name
/**
* Bypass Force Login to allow for exceptions.
*
* @param bool $bypass Whether to disable Force Login. Default false.
* @return bool
*/
function my_forcelogin_bypass( $bypass ) {
// Allow URL if query string ‘[parameter]’ exists
if ( isset( $_GET[‘f’] ) ) {
$bypass = true;
}
// Allow URL where ‘value’ is equal to query string ‘parameter’
if ( $_GET[‘f’] == ‘2’ ) {
$bypass = true;
}
return $bypass;
}
add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’ );
Either one of those conditional statements would work, it just depends on how specific you want to be.
Do you want to allow URLs with the ?f query string and any value, or only allow URLs with an ?f=2 query string?
Or, you could be more specific and only allow the Gravity Form embed page with form ID of “2”:
// Allow Gravity Forms iFrame embed URLs
if ( function_exists( 'is_gfiframe_template' ) && is_gfiframe_template() ) {
// Allow GF form ID "2"
if ( $_GET['f'] == '2' ) {
$bypass = true;
}
}