redirect_me

Login Logout redirect.

Description

redirect_me(); 

Usage

  1. if ( !function_exists( 'redirect_me' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = redirect_me(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function redirect_me() { 
  2. //if the user has rights of editor then return don't do anything 
  3. //if(current_user_can('editor')) return; 
  4.  
  5. //get the reffer or you may user home_url() if the "request_to" is not set 
  6. $logout_redirect_url = $_SERVER['HTTP_REFERER']; 
  7. if( ! empty( $_REQUEST['redirect_to'] ) ) wp_safe_redirect( $_REQUEST['redirect_to'] ); 
  8. else wp_redirect( $logout_redirect_url ); 
  9. exit();