auth_cookie
Filters the authentication cookie.
Usage
add_filter( 'auth_cookie', 'wp_kama_auth_cookie_filter', 10, 5 );
/**
* Function for `auth_cookie` filter-hook.
*
* @param string $cookie Authentication cookie.
* @param int $user_id User ID.
* @param int $expiration The time the cookie expires as a UNIX timestamp.
* @param string $scheme Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.
* @param string $token User's session token used.
*
* @return string
*/
function wp_kama_auth_cookie_filter( $cookie, $user_id, $expiration, $scheme, $token ){
// filter...
return $cookie;
}
- $cookie(string)
- Authentication cookie.
- $user_id(int)
- User ID.
- $expiration(int)
- The time the cookie expires as a UNIX timestamp.
- $scheme(string)
- Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.
- $token(string)
- User's session token used.
Changelog
| Since 2.5.0 | Introduced. |
| Since 4.0.0 | The $token parameter was added. |
Where the hook is called
auth_cookie
wp-includes/pluggable.php 984
return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );