WordPress.org

Ready to get started?Download WordPress

Codex

Plugin API/Filter Reference/login url

Contents

Description

login_url is a filter applied to the url returned by the function wp_login_url()

Parameters

$login_url
(string) (required) The URL for login
Default: None
$redirect
(string) (required) The URL to redirect back to upon successful login
Default: None

Examples

The following example would return a login URL http://mydomain.com/my-login-page/ for the wp_login_url() function:

function my_login_page( $login_url, $redirect ) {
    $new_login_url = home_url() . '/my-login-page/?redirect_to=' . $redirect;
    return $new_login_url;
}
add_filter( 'login_url', 'my_login_page', 10, 2 );

Change Log

Since: Version 2.8

Source Files

login_url is located in wp-includes/general-template.php

Related