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

    (@kevinvess)

    Try adding the following code to your theme’s functions.php file:

    /**
     * Filter Force Login to allow exceptions for specific URLs.
     *
     * @return array An array of URLs. Must be absolute.
     **/
    function my_forcelogin_whitelist() {
      return array(
        site_url( '/xmlrpc.php' )
      );
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);
    Thread Starter steveburkie82

    (@steveburkie82)

    Hi Kevin,

    Thanks for the reply, this was the first thing I added but no joy.

    Plugin Author Kevin Vess

    (@kevinvess)

    Ok, try this instead:

    /**
     * Filter Force Login to allow exceptions for specific URLs.
     *
     * @return array An array of URLs. Must be absolute.
     **/
    function my_forcelogin_whitelist() {
      // list of single page URLs
      $my_whitelist = array(
        site_url( '/xmlrpc.php' )
      );
      // add any page URL within a directory to my whitelist
      if( in_array('jetpack', explode('/', $_SERVER['REQUEST_URI'])) ) {
        $my_whitelist[] = site_url($_SERVER['REQUEST_URI']);
      }
      return $my_whitelist;
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);
    Plugin Author Kevin Vess

    (@kevinvess)

    Or you could try this instead:

    /**
     * Filter Force Login to allow exceptions for specific URLs.
     *
     * @return array An array of URLs. Must be absolute.
     **/
    function my_forcelogin_whitelist() {
      // list of single page URLs
      $my_whitelist = array(
        site_url( '/xmlrpc.php' )
      );
      // add any page URL within a directory to my whitelist
      if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
        $my_whitelist[] = site_url($_SERVER['REQUEST_URI']);
      }
      return $my_whitelist;
    }
    add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1)
    Thread Starter steveburkie82

    (@steveburkie82)

    Hi Kevin,

    I tried both with no joy.
    Just to confirm I am adding this code to my themes functions.php file?

    Thanks,
    Steve.

    Plugin Author Kevin Vess

    (@kevinvess)

    Yes, you should be adding this code to your theme’s functions.php file.

    Let me know if you figure out how to whitelist the Jetpack plugin.

    Plugin Author Kevin Vess

    (@kevinvess)

    I just released a new version (4.0) that might address this issue. Let me know if the problem still exists. Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘JetPacks – Post By Email’ is closed to new replies.