Summery Summery
Display the Registration or Admin link.
Syntax Syntax
Description Description
Display a link which allows the user to navigate to the registration page if not logged in and registration is enabled or to the dashboard if logged in.
Parameters Parameters
- $before
-
(Optional) Text to output before the link. Default
<li>.Default value: '<li>'
- $after
-
(Optional) Text to output after the link. Default
</li>.Default value: '</li>'
- $echo
-
(Optional) Default to echo and not return the link.
Default value: true
Return Return
(void|string) Void if $echo argument is true, registration or admin link if $echo is false.
Source Source
File: wp-includes/general-template.php
echo $form;
} else {
return $form;
}
}
/**
* Returns the URL that allows the user to retrieve the lost password
*
* @since 2.8.0
*
* @param string $redirect Path to redirect to on login.
* @return string Lost password URL.
*/
function wp_lostpassword_url( $redirect = '' ) {
$args = array(
'action' => 'lostpassword',
);
if ( ! empty( $redirect ) ) {
$args['redirect_to'] = urlencode( $redirect );
}
if ( is_multisite() ) {
$blog_details = get_blog_details();
$wp_login_path = $blog_details->path . 'wp-login.php';
} else {
$wp_login_path = 'wp-login.php';
}
$lostpassword_url = add_query_arg( $args, network_site_url( $wp_login_path, 'login' ) );
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |