auth_cookie_valid
Fires once an authentication cookie has been validated.
Использование
add_action( 'auth_cookie_valid', 'wp_kama_auth_cookie_valid_action', 10, 2 ); /** * Function for `auth_cookie_valid` action-hook. * * @param string[] $cookie_elements Authentication cookie components. * @param WP_User $user User object. * * @return void */ function wp_kama_auth_cookie_valid_action( $cookie_elements, $user ){ // action... }
- $cookie_elements(string[])
Authentication cookie components.
-
username(строка)
User's username. -
expiration(строка)
The time the cookie expires as a UNIX timestamp. -
token(строка)
User's session token used. -
hmac(строка)
The security hash for the cookie. - scheme(строка)
The cookie scheme to use.
-
- $user(WP_User)
- User object.
Список изменений
С версии 2.7.0 | Введена. |
Где вызывается хук
auth_cookie_valid
wp-includes/pluggable.php 837
do_action( 'auth_cookie_valid', $cookie_elements, $user );
Где используется хук в WordPress
wp-includes/default-filters.php 327
add_action( 'auth_cookie_valid', 'rest_cookie_collect_status' );