WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/login url

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: http://example.com/wp-login.php
$redirect
(string) (optional) The URL to redirect back to upon successful login.
Default: None

Examples

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

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

Change Log

Since: Version 2.8

Source File

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

Related