Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.

wp_login ›

wp_login ( $username, $password, $deprecated = '' )
Parametry: (3)
  • (string) $username User's username
    Wymagane: Tak
  • (string) $password User's password
    Wymagane: Tak
  • (string) $deprecated Not used
    Wymagane: Nie
    Domyślny: (puste)
  • (bool) False on login failure, true on successful check
Zdefiniowane na:

Checks a users login information and logs them in if it checks out. This function is deprecated.

Use the global $error to get the reason why the login failed. If the username is blank, no error will be set, so assume blank username on that case.

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


function wp_login($username, $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->get_error_message();
	return false;