On this page
user_pass_ok( string $user_login, string $user_pass ): bool
This function has been deprecated. Use wp_authenticate() instead.
Check that the user login name and password is correct.
Description
See also
Parameters
$user_loginstring Required-
User name.
$user_passstring Required-
User password.
Return
bool False if does not authenticate, true if username and password authenticates.
Source
File: wp-includes/deprecated.php. View all references
function user_pass_ok($user_login, $user_pass) {
_deprecated_function( __FUNCTION__, '3.5.0', 'wp_authenticate()' );
$user = wp_authenticate( $user_login, $user_pass );
if ( is_wp_error( $user ) )
return false;
return true;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_authenticate() wp-includes/pluggable.php | Authenticates a user, confirming the login credentials are valid. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| is_wp_error() wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Use wp_authenticate() |
| 0.71 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/user_pass_ok