Support » Plugin: Force Login » Not working on mobile [SOLVED]

  • Resolved ivanlinares

    (@ivanlinares)


    Hi, thank you for such an excellent plugin.

    i have a site up and running in bosquedemagnolias.com and this is my 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( '/' );
      $whitelist[] = site_url( '/quienes-somos/' );
      $whitelist[] = site_url( '/como-llegar/' );
      $whitelist[] = site_url( '/xmlrpc.php' );
     $url_path = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
      // Whitelist URLs
      if ( '/condominos/contacto-administrador/' === $url_path ) {
      $whitelist[] = site_url($_SERVER['REQUEST_URI']);
      }
      if ( '/condominos/contacto-administrador.php' === $url_path ) {
      $whitelist[] = site_url($_SERVER['REQUEST_URI']);
      }
      return $whitelist;
    }
    
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);

    I’m visiting the site from the PC and works, but if you try to visit from mobile you get an error…

    Just to help other users, be careful with the JetPack option ‘optimize your site to use on mobile devices’, be sure this monster is turned OFF.

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

    (@kevinvess)

    Hi – thanks for using Force Login!

    I’m glad its working well for you and thanks for sharing this tip with others.

    Enjoy!

Viewing 1 replies (of 1 total)
  • The topic ‘Not working on mobile [SOLVED]’ is closed to new replies.