• Resolved McMurdo1

    (@mcmurdo1)


    I’m trying to whitelist a group of sites but running into some problems. Below is the code I have in my functions.php. The home page (“/”) whitelists fine, but none of the others do. I keep getting redirected. Am I missing something?

    /**
    * Filter Force Login to allow exceptions for specific URLs.
    *
    * @return array An array of URLs. Must be absolute.
    **/
    function my_forcelogin_whitelist( $whitelist ) {
    $whitelist[] = site_url( ‘/register-2/’ );
    $whitelist[] = site_url( ‘/’ );
    $whitelist[] = site_url( ‘/features/‘ );
    $whitelist[] = site_url( ‘/faqs/’ );

    return $whitelist;
    }
    add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);

    https://www.ads-software.com/plugins/wp-force-login/

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

    (@kevinvess)

    The code you’re using in the theme’s functions.php file looks correct –?however, those quotes around the path look a little off, but that could be from pasting it into the forum as text and not code.

    /**
    * Filter Force Login to allow exceptions for specific URLs.
    *
    * @return array An array of URLs. Must be absolute.
    **/
    function my_forcelogin_whitelist( $whitelist ) {
      $whitelist[] = site_url( '/register-2/' );
      $whitelist[] = site_url( '/' );
      $whitelist[] = site_url( '/features/' );
      $whitelist[] = site_url( '/faqs/' );
      return $whitelist;
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);

    I would try turning on the WP_DEBUG mode in your wp-config.php file to check for errors.
    https://codex.www.ads-software.com/Debugging_in_WordPress#WP_DEBUG

    Also, try following these steps to determine the cause of your issue as it may be related to another plugin or piece of code within your current theme:
    https://www.ads-software.com/support/topic/infinite-loop-5#post-5933211

Viewing 1 replies (of 1 total)
  • The topic ‘Problems with Whitelist’ is closed to new replies.