mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
8 lines
339 B
Text
8 lines
339 B
Text
function extend_auth_cookie_expiration( $expiration, $user_id, $remember ) {
|
|
// Set the desired cookie expiration time (48 hours in this example)
|
|
$cookie_expire = 2 * DAY_IN_SECONDS;
|
|
|
|
// Return the new expiration time
|
|
return $cookie_expire;
|
|
}
|
|
add_filter( 'auth_cookie_expiration', 'extend_auth_cookie_expiration', 10, 3 );
|