Support » Plugin: Force Login » Multisite Subsite Exceptions

  • Resolved celebrantplanner

    (@celebrantplanner)


    Hi – Great plug in, thank you.

    Ive added the following code in my functions.php file to whitelist certain pages on my subsites which need to be made available to public. Each subsite is a different user account and are setup as {subsite}.celebrantplanner.com.au.

    The pages are all named the same in each subsite, but the code below isnt allowing anyone to access the ‘https://testuser.celebrantplanner.com.au/booking-form’ page without logging in.

    What am I doing wrong or is there a better way to whitelist the pages below for each subsite?

    Thanking you in advance.

    CODE

    function my_forcelogin_bypass( $bypass ) {

    if ( is_page(‘booking-form’) || is_page(‘NOIM’) || is_page(‘check-availability’) || is_page(‘home-user’) || is_page(‘gallery-user’)|| is_page(‘wording’) ) {
    $bypass = true;
    }
    return $bypass;
    }
    add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’ );

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • celebrantplanner

    (@celebrantplanner)

    I’ll take that back, it is working! I changed my permalinks so that was the issue, not this plugin 🙂

    Plugin Author Kevin Vess

    (@kevinvess)

    Hi– thanks for using Force Login!

    I’m glad you were able to resolve the issue. 🙂

    Also, you could simplify your conditional statement to the following:

    if ( is_page( array( 'booking-form', 'NOIM', 'check-availability', 'home-user', 'gallery-user', 'wording' ) ) ) {
        $bypass = true;
    }

    The is_page() function accepts a Page ID, title, slug, or array of such.

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

    Thanks!

    • This reply was modified 3 weeks, 1 day ago by  Kevin Vess.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.