This documentation describes unreleased changes on the main branch.

wp_is_user_logged_in()

Twig function of the framework; its result is escaped like any value.

{{ wp_is_user_logged_in() }}

Whether the visitor is logged in, as returned by is_user_logged_in(). In a block with #[Cache], the cache must vary by LoggedInVary, RoleVary or UserVary; otherwise the call throws an error.

{% if wp_is_user_logged_in() %}
    <a href="{{ wp_logout_url() }}">Log out</a>
{% endif %}

Returns bool