is_login

The timeline below displays how wordpress function is_login has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Determines whether the current request is for the login screen.
 *
 * @since 6.1.0
 *
 * @see wp_login_url()
 *
 * @return bool True if inside WordPress login screen, false otherwise.
 */
function is_login()
{
    return false !== stripos(wp_login_url(), $_SERVER['SCRIPT_NAME']);
}