auth_cookie хук-фильтрWP 2.5.0

Filters the authentication cookie.

Использование

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(строка)
Authentication cookie.
$user_id(int)
User ID.
$expiration(int)
The time the cookie expires as a UNIX timestamp.
$scheme(строка)
Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'.
$token(строка)
User's session token used.

Список изменений

С версии 2.5.0 Введена.
С версии 4.0.0 The $token parameter was added.

Где вызывается хук

wp_generate_auth_cookie()
auth_cookie
wp-includes/pluggable.php 890
return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );

Где используется хук в WordPress

Использование не найдено.