title: How to redirect logged in users conditionally?
body: <p>Now i know that if i want to redirect logged in users to the current page they are already in i should use this filter</p>
  
  <pre><code>function pro_redirect_to_request( $redirect_to, $request, $user ){
  // instead of using $redirect_to we're redirecting back to $request
  return $request;
  }
  add_filter('login_redirect', 'pro_redirect_to_request', 10, 3);
  </code></pre>
  
  <p>but now i have a custom login page which i want to redirect users who are logging from this page to a custom page, i mean by that the homepage. So I made these edits to the filter but it doesn't work.</p>
  
  <pre><code>function pro_redirect_to_request( $redirect_to, $request, $user ){
  // instead of using $redirect_to we're redirecting back to $request
  if ($request == 'http://prosentra.com/login'){
      wp_redirect(home_url(""));
      exit();
  }else{
  return $request;
  }
  }
  add_filter('login_redirect', 'pro_redirect_to_request', 10, 3);
  </code></pre>
  
  <p>Here i ask if the page that user requested logging in from equals this url '<a href="http://prosentra.com/login" rel="nofollow noreferrer">http://prosentra.com/login</a>' then redirect me to home page , and if not redirect me to the current page.
  What modifications should i do?</p>