Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Stiggy

    (@stiggy)

    I setup a local demo version to see if I could pinpoint the problem (I had my theme and plugins all installed). I managed to get it to work using:

    function my_forcelogin_whitelist( $whitelist ) {
      $whitelist[] = home_url( '/feed/' );
      $whitelist[] = home_url( '/?feed=rss2/' );
      return $whitelist;
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);

    I found I needed both / at the beginning and the end.

    However on my live site it didn’t work, I kept playing around until I found that this worked:

    function my_forcelogin_whitelist( $whitelist ) {
      $whitelist[] = site_url( 'feed' );
      $whitelist[] = site_url( '?feed=rss2' );
    
      return $whitelist;
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);

    I had to use site_url instead of home_url and also needed to remove the forward slashes. It now seems to be working as it should – thanks for all your help, it’s been really useful!

    Thread Starter Stiggy

    (@stiggy)

    Hi Kevin,

    Thanks for the speedy response, I’ve tried home_url, site_url and an absolute path (http://mysite.com/feed).

    I’m taken to the following URL when I try to go to the feed link:

    http://mysite.com/login?redirect_to=http%3A%2F%2Fmysite.com%2Ffeed

    I have used a plugin to change my login from wp-admin to login. However I have turned it off to see if that was causing an issue and the same problem was occurring.

    Would I want to try using Method 4 in the dynamic URL?

    Edit:
    I tried adding this snippet somewhere:
    https://gist.github.com/kevinvess/7b4478446bcec77b4916#file-wp-force-login-xmlrpc-php-L6

    however it only seemed to break the site.. I’m not sure if I was adding it in the correct place.

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