• Resolved nkoltys

    (@nkoltys)


    To the provided Bypass Login code, I added only the below absolute URL to bypass login prompt when the sweetbriar.org/calendar. Is syntax or location correct? This code was then inserted to the bottom of the existing functions.php w/in my Activation theme folder. When testing the URL in the browser nothing rendered.
    ———————————————-
    /**
    * Bypass Force Login to allow for exceptions.
    *
    * @param bool $bypass Whether to disable Force Login. Default false.
    * @return bool
    */
    function my_forcelogin_bypass( $bypass ) {
    if ( https://sweetbriarfarms.org/calendar/ ) {
    $bypass = true;
    }
    return $bypass;
    }
    add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’ );
    ——————————————

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

    (@kevinvess)

    Hi, thanks for using Force Login!

    Your syntax is wrong, specifically the conditional statement. Change it to the following:

    if ( is_page( 'calendar' ) ) {
    
    Thread Starter nkoltys

    (@nkoltys)

    Thank you for your quick reply, much appreciated.

    I made your edit but not in the Theme’s functions.php instead in the plugin’s WP-Force-Login.php. If this is not best practice, please advise.

    It appears to be working.

    Plugin Author Kevin Vess

    (@kevinvess)

    Hi, I’m glad you got it working!

    However, editing plugin files is not best practice. If you update the plugin, all of your custom changes will be lost.

    It’s better to apply custom changes through hooks and filters via your theme’s functions.php file or a custom plugin of your own.

    Be sure to rate and review my plugin to let others know how you like it.

    Thanks for using Force Login!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bypass Force Login code question’ is closed to new replies.