• Resolved celebrantplanner

    (@celebrantplanner)


    Hi – I have a Gravity Forms iframe embedded in another website, but the frame only shows the login page, not the form. I think this is due to Force Login. How do I whitelist forms as they arent attached to a page as such.

    Thanks

    The page I need help with: [log in to see the link]

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

    (@kevinvess)

    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.

    Thread Starter celebrantplanner

    (@celebrantplanner)

    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’ );

    Plugin Author Kevin Vess

    (@kevinvess)

    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;
        }
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Multisite Subsite issue’ is closed to new replies.