Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. //How to redirect logins based upon a variable!
  2.  
  3. //This function returns a redirect location based upon a variable. 
  4. function overHere() {
  5.     //Declare variables.
  6.     $variable = true;
  7.  
  8.     if (!$variable) {
  9.         $redirect_to = "/here";
  10.         return $redirect_to;
  11.     } else {
  12.         $redirect_to = "/there";
  13.         return $redirect_to;
  14.     }
  15. }
  16.  
  17. //Add that filter with eleven priority!
  18. add_filter('login_redirect', 'overHere', 11);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement