pmpro_redirect_to_logged_in

If a redirect_to value is passed into /login/ and you are logged in already, just redirect there.

Description

pmpro_redirect_to_logged_in(); 

Usage

  1. if ( !function_exists( 'pmpro_redirect_to_logged_in' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/login.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_redirect_to_logged_in(); 
  7.  

Defined (1)

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

/includes/login.php  
  1. function pmpro_redirect_to_logged_in() 
  2. {  
  3. if((pmpro_is_login_page() || is_page("login")) && !empty($_REQUEST['redirect_to']) && is_user_logged_in() && (empty($_REQUEST['action']) || $_REQUEST['action'] == 'login') && empty($_REQUEST['reauth'])) 
  4. wp_redirect($_REQUEST['redirect_to']); 
  5. exit;