WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wp_validate_logged_in_cookie() WP 3.9.0

Validates the logged-in cookie.

Checks the logged-in cookie if the previous auth cookie could not be validated and parsed.

This is a callback for the 'determine_current_user' filter, rather than API.

Хуков нет.


Число/false. User ID if validated, false otherwise. If a user ID from an earlier filter callback is received, that value is returned.


wp_validate_logged_in_cookie( $user_id );
$user_id(число/true/false) (обязательный)
The user ID (or false) as received from the determine_current_user filter.

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

С версии 3.9.0 Введена.

Код wp validate logged in cookie: wp-includes/user.php WP 5.2.2

function wp_validate_logged_in_cookie( $user_id ) {
	if ( $user_id ) {
		return $user_id;

	if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
		return false;

	return wp_validate_auth_cookie( $_COOKIE[ LOGGED_IN_COOKIE ], 'logged_in' );