• Resolved Prince

    (@princeramgarhia)


    Hi Thank you for the plugin I want to whitelist a URL but for some reasons, it is not working
    here is what I am doing in functions.php

    /**
     * Bypass Force Login to allow for exceptions.
     *
     * @param bool $bypass Whether to disable Force Login. Default false.
     * @param string $visited_url The visited URL.
     * @return bool
     */
    function my_forcelogin_bypass( $bypass, $visited_url ) {
    
      // Allow these absolute URLs
      $allowed = array(
        home_url( '/wholesale-account-application/' ),
      );
      if ( ! $bypass ) {
        $bypass = in_array( $visited_url, $allowed );
      }
    
      return $bypass;
    }
    add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 2 );
    • This topic was modified 2 years, 10 months ago by Prince.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Hi– thanks for using Force Login!

    Your code looks correct. Try using the is_page() conditional tag to determine whether or not to bypass Force Login instead of the absolute URL.

    Unfortunately, I’m unable to troubleshoot this issue without access to your site and the hosting environment.

    I recommend you hire a web developer to help you customize this for your site.

    Good luck!

    Thread Starter Prince

    (@princeramgarhia)

    it’s done working now thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Whitelist url not working’ is closed to new replies.