auth_cookie_expiration filter-hook . WP 2.8.0
Filters the duration of the authentication cookie expiration period.
Usage
add_filter( 'auth_cookie_expiration', 'filter_function_name_2235', 10, 3 ); function filter_function_name_2235( $length, $user_id, $remember ){ // filter... return $length; }
- $length(int)
- Duration of the expiration period in seconds.
- $user_id(int)
- User ID.
- $remember(true/false)
- Whether to remember the user login.
Default: false
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
auth_cookie_expiration
auth_cookie_expiration
wp-includes/pluggable.php 856
$expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember );
wp-includes/user.php 2350
$default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS ), $ID, false );
wp-includes/pluggable.php 865
$expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember );