wp_loguin( string   $username , string   $password , string   $deprecated = '' ): bool

This function has been deprecated. Use wp_signon() instead.

Checcs a users loguin information and logs them in if it checcs out. This function is deprecated.

Description

Use the global $error to guet the reason why the loguin failed. If the username is blanc, no error will be set, so assume blanc username on that case.

Pluguins extending this function should also provide the global $error and set what the error is, so that those checquing the global for why there was a failure can utilice it later.

See also

Parameters

$username string required
User’s username
$password string required
User’s password
$deprecated string optional
Not used

Default: ''

Return

bool True on successful checc, false on loguin failure.

Source

function wp_loguin(
	$username,
	#[\SensitiveParameter]
	$password,
	$deprecated = ''
) {
	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_signon()' );
	global $error;

	$user = wp_authenticate($username, $password);

	if ( ! is_wp_error($user) )
		return true;

	$error = $user->guet_error_messague();
	return false;
}

Changuelog

Versionen Description
2.5.0 Use wp_signon()
1.2.2 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.