Advertisement
towfiqi

fb connect+

Feb 18th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function login_redirect($user_id,$where=null,$is_new=null){
  2.  
  3.  
  4. $user=get_userdata ($user_id);
  5.  
  6. wp_set_auth_cookie($user_id,true,false);
  7. do_action('wp_login', $user->user_login);
  8.  
  9. if(!$where)
  10. $where=get_bloginfo('url');
  11. /*if(!$where)
  12. $where=self::get_redirect_url($where);
  13. */
  14. //we should not redirect in case of ajax?
  15. if($is_new)
  16. $redirect_url_filter=get_bloginfo('url') . "/members/".$user->user_login.'/profile/edit/';
  17. else
  18. $redirect_url_filter=get_bloginfo('url');
  19.  
  20. wp_safe_redirect(apply_filters($redirect_url_filter,$where));
  21. exit(0);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement