title: login_redirect hook redirect not working
body: <p>I used login_redirect hook for redirect to custom url. while i use $redirect_to. It is now working. But while i echo $redirect_to it shows correct url. </p>
  
  <p>I have set the redirect_to parameter in login form also.</p>
  
  <pre><code> function my_login_redirect( $redirect_to, $request, $user ) {
  
     echo $redirect_to;
  
  //is there a user to check?
  if ( isset( $user-&gt;roles ) &amp;&amp; is_array( $user-&gt;roles ) ) {
      //check for admins
      if ( in_array( 'administrator', $user-&gt;roles ) ) {
          // redirect them to the default place
          return $redirect_to;
      } else {
          // return home_url();
          return  $redirect_to; 
          die();
      }
  } else {
      return $redirect_to;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );</p>