bp_core_login_redirect

Filters whether or not to redirect.

Description

apply_filters( 'bp_core_login_redirect', (bool) $false, (string) $redirect_to, (string) $redirect_to_raw, (WP_User) $user ); 

Allows plugins to have finer grained control of redirect upon login.

Parameters (4)

0. $false (bool) => false
Whether or not to redirect.
1. $redirect_to (string)
Sanitized URL to be redirected to.
2. $redirect_to_raw (string)
Unsanitized URL to be redirected to.
3. $user (WP_User)
The WP_User object corresponding to a successfully logged in user.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'bp_core_login_redirect', $false, $redirect_to, $redirect_to_raw, $user ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_core_login_redirect callback 
  2. function filter_bp_core_login_redirect( $false, $redirect_to, $redirect_to_raw, $user ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_core_login_redirect', 'filter_bp_core_login_redirect', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_core_login_redirect', 'filter_bp_core_login_redirect', 10, 4 ); 

Defined (1)

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

/bp-core/bp-core-filters.php  
  1. $maybe_redirect = apply_filters( 'bp_core_login_redirect', false, $redirect_to, $redirect_to_raw, $user );