I perceive that the next filter modifies the parameters of the authentication cookies, in reality I’ve managed to change its worth since it’s the first parameter $cookie, however what I would like is to change the parameter $expiration that interprets to Expires within the cookie.
So how might I modify the third parameter $expiration provided that solely $cookie could be returned and the remainder appear to be in context?
add_filter( "auth_cookie", "modify_auth_cookie_defaults", 10, 5 );
operate modify_auth_cookie_defaults($cookie, $user_id, $expiration, $scheme, $token) {
return str_replace( $expiration, DAY_IN_SECONDS, $expiration );
}
add_filter( "auth_cookie", "modify_auth_cookie_defaults", 10, 5 );
operate modify_auth_cookie_defaults($cookie, $user_id, $expiration, $scheme, $token) {
$expiration = YEAR_IN_SECONDS
return $expiration;
}