WordPress V5.0+Template Tag Reference Guide as of Version 5.2
Presented by DBS > Interactive Development :

Login/Logout Tags
Is User Logged In is_user_logged_in();
This Conditional Tag checks if the current visitor is logged in. This is a boolean function, meaning it returns either true or false.
<?php is_user_logged_in(); ?>
No parameters.
WP Login Form wp_login_form();
Provides a simple login form for use anywhere within WordPress. By default, it echoes the HTML immediately. Pass array('echo' => false) to return the string instead. Arguments are passed in as either an array or a query string.
$args = array( | ||||
'echo' | => | true, | ||
'redirect' | => | site_url( $_SERVER['REQUEST_URI'] ), | ||
'form_id' | => | 'loginform', | ||
'label_username' | => | __('Username'), | ||
'label_password' | => | __('Password'), | ||
'label_log_in' | => | __('Log In'), | ||
'id_username' | => | 'user_login', | ||
'id_password' | => | 'user_pass', | ||
'id_remember' | => | 'rememberme', | ||
'id_submit' | => | 'wp-submit', | ||
'remember' | => | true, | ||
'value_username' | => | null, | ||
'value_remember' | => | false | ||
); |
<?php wp_login_form($args); ?>
echo
Boolean • Default: true
(Optional) Display the results (true) or return them for use in PHP (false).
redirect
String • Default: the current page
(Optional) Must be absolute (as in, http://example.com/mypage/). Recommended: site_url( '/mypage/ ' ).
form_id
String • Default: 'loginform'
(Optional) form_id
remember
Boolean • Default: true
(Optional) Whether to remember the values.
value_username
String • Default: null
(Optional) Username
value_remember
String • Default: false
(Optional)
WP Login URL wp_login_url();
This Template Tag returns the URL that allows the user to log out of the site.
<?php wp_login_url($redirect); ?>
$redirect
String • Default: none
(Optional) URL to redirect to on login.
WP Login/Logout wp_loginout();
Displays a login link, or if a user is logged in, displays a logout link. An optional, redirect argument can be used to redirect the user upon login or logout.
<?php wp_loginout($redirect); ?>
$redirect
String • Default: none
(Optional) URL to redirect to on login/logout.
WP Logout wp_logout();
Log the current user out by destroying the current user session.
<?php wp_logout(); ?>
No parameters.
WP Logout URLwp_logout_url();
This Template Tag returns the URL that allows the user to log out to the site.
<?php echo wp_logout_url($redirect); ?>
$redirect
String • Default: none
(Optional) URL to redirect to on logout.
WP Lost Password URLwp_lostpassword_url();
This Template Tag returns the URL that allows the user to retrieve the lost password.
<?php echo wp_lostpassword_url($redirect); ?>
$redirect
String • Default: none
(Optional) URL to redirect to after retrieving the lost password.
WP Registerwp_register();
This tag displays either the "Register" if the user is logged in or "Site Admin" link the user is not logged in. The "Register" link is not offered if the Administration > Settings > General > Membership: Anyone can register box is not checked.
<?php echo wp_register($before, $after, $echo); ?>
$before
String • Default: '<li>'
(Optional) Text to display before the Register or Site Admin link.
$after
String • Default: '</li>'
(Optional) Text to display after the Register or Site Admin link.
$echo
Boolean • Default: true
(Optional) If true, echos the link, if false, returns the link as a string.