auth_cookie_expiration

The WordPress Core auth cookie expiration hook.

Description

apply_filters( 'auth_cookie_expiration', (unknown) _day_in_seconds, (unknown) $id, (bool) $false ); 

Parameters (3)

0. $2_day_in_seconds (unknown) => ( 2 * DAY_IN_SECONDS )
The 2 day in seconds.
1. $id (unknown)
The id.
2. $false (bool) => false
The false.

Usage

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

Defined (3)

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

/wp-includes/user.php  
  1. $default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS ), $ID, false ); 
/wp-includes/pluggable.php  
  1. $expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember ); 
  1. $expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );