Values#
| Value | Meaning |
|---|---|
{{ logged_in }} | Whether the current visitor is logged in. |
{{ registration_open }} | Whether WordPress registration is enabled. |
{{ auth_action }} | Current auth action, such as login, register, lost-password, or reset-password. |
{{ auth_login_url }} | Login URL. |
{{ auth_lost_password_url }} | Lost-password URL. |
{{ auth_register_url }} | Register URL. |
{{ auth_logout_url }} | Logout URL. |
Branching#
Use auth_action when one file renders more than one screen:
{{ if auth_action == "lost-password" }} <h1>Reset your password</h1>{{ else if auth_action == "register" }} <h1>Create account</h1>{{ else }} <h1>Log in</h1>{{ /if }}Links#
Use the auth URL values instead of hardcoding wp-login.php links:
<a href="{{ auth_lost_password_url }}">Forgot password?</a><a href="{{ auth_register_url }}">Register</a><a href="{{ auth_logout_url }}">Log out</a>