send_auth_cookies хук-фильтрWP 4.7.4

Allows preventing auth cookies from actually being sent to the client.

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

add_filter( 'send_auth_cookies', 'wp_kama_send_auth_cookies_filter', 10, 6 );

/**
 * Function for `send_auth_cookies` filter-hook.
 * 
 * @param bool   $send       Whether to send auth cookies to the client.
 * @param int    $expire     The time the login grace period expires as a UNIX timestamp. Zero when clearing cookies.
 * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp. Zero when clearing cookies.
 * @param int    $user_id    User ID. Zero when clearing cookies.
 * @param string $scheme     Authentication scheme. Values include 'auth' or 'secure_auth'. Empty string when clearing cookies.
 * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
 *
 * @return bool
 */
function wp_kama_send_auth_cookies_filter( $send, $expire, $expiration, $user_id, $scheme, $token ){

	// filter...
	return $send;
}
$send(true|false)
Whether to send auth cookies to the client.
По умолчанию: true
$expire(int)
The time the login grace period expires as a UNIX timestamp. Zero when clearing cookies.
По умолчанию: 12 hours past the cookie's expiration time
$expiration(int)
The time when the logged-in authentication cookie expires as a UNIX timestamp. Zero when clearing cookies.
По умолчанию: 14 days from now
$user_id(int)
User ID. Zero when clearing cookies.
$scheme(строка)
Authentication scheme. Values include 'auth' or 'secure_auth'. Empty string when clearing cookies.
$token(строка)
User's session token to use for this cookie. Empty string when clearing cookies.

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

С версии 4.7.4 Введена.
С версии 6.2.0 The $expire, $expiration, $user_id, $scheme, and $token parameters were added.

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

wp_set_auth_cookie()
send_auth_cookies
wp_clear_auth_cookie()
send_auth_cookies
wp-includes/pluggable.php 1089
if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
wp-includes/pluggable.php 1117
if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {

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

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