وردپرس نسخه 3,0+مرجع توابع مورد استفاده در کد نویسی پوسته
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.
<?php wp_login_form($args); ?>
Default arguments:
<?php $args = array( | ||
'echo' | => | true, |
'redirect' | => | site_url( $_SERVER['REQUEST_URI'] ), |
'form_id' | => | 'loginform', |
'label_username' | => | __( 'Username' ), |
'label_password' | => | __( 'Password' ), |
'label_remember' | => | __( 'Remember Me' ), |
'label_log_in' | => | __( 'Log In' ), |
'id_username' | => | 'user_login', |
'id_password' | => | 'user_pass', |
'id_remember' | => | 'rememberme', |
'id_submit' | => | 'wp-submit', |
'remember' | => | true, |
'value_username' | => | , |
'value_remember' | => | false |
); | ||
?> |
echo
Boolean
(Optional) Display the results. Options are:
- 1 (true) - Default
- 0 (false)
redirect
String
URL to redirect to. Default: the current page.
form_id
String
(Optional) Default: loginform.
remember
Boolean
(Optional) Whether to remember the values.
- 1 (true) - Default
- 0 (false)
value_username
String
(Optional) Default: loginform.
value_remember
String
(Optional).
- 1 (true)
- 0 (false) - Default
WP Login URL wp_login_url();
This Template Tag returns the URL that allows the user to log in to the site.
<?php wp_login_url($redirect); ?>
$redirect
String
(Optional) URL to redirect to on login. Default: none.
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
(Optional) URL to redirect to on login/logout. Default: none.
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
(Optional) URL to redirect to on logout. Default: none.
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
(Optional) URL to redirect to after retrieving the lost password. Default: none.
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
(Optional) Text to display before the Register or Site Admin link. Default: '<li>'
$after
String
(Optional) Text to display after the Register or Site Admin link. Default: '</li>'
$echo
Boolean
(Optional) If true, echos the link, if false, returns the link as a string. Default: True.