WordPress at a glance

is_user_logged_in() WP 1.0

Checks if the current visitor is a logged in user.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Возвращает

true/false. True if user is logged in, false if not logged in.

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

is_user_logged_in();

Changelog

Since 2.0.0 Introduced.

Код is_user_logged_in() WP 5.5.1

<?php
function is_user_logged_in() {
	$user = wp_get_current_user();

	return $user->exists();
}

From tag: Users (_user)

More from tag: Conditional tags (all)

More from category: Login/Logout

More from Template Tags: Authors

No comments
    Log In . Register