Deprecate user_pass_ok() in favor of wp_authenticate(). see #21907.

git-svn-id: http://core.svn.wordpress.org/trunk@21911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-19 01:35:35 +00:00
parent c178b59da3
commit 1f9ce958f7
2 changed files with 20 additions and 18 deletions

View File

@ -3224,3 +3224,23 @@ function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
return get_post( $postid, $mode, 'edit' );
}
/**
* Check that the user login name and password is correct.
*
* @since 0.71
* @deprecated 3.5.0
* @deprecated Use wp_authenticate()
* @see wp_authenticate()
*
* @param string $user_login User name.
* @param string $user_pass User password.
* @return bool False if does not authenticate, true if username and password authenticates.
*/
function user_pass_ok($user_login, $user_pass) {
_deprecated_function( __FUNCTION__, '3.5', 'wp_authenticate()' );
$user = wp_authenticate( $user_login, $user_pass );
if ( is_wp_error( $user ) )
return false;
return true;
}

View File

@ -191,24 +191,6 @@ function count_many_users_posts( $users, $post_type = 'post' ) {
return $count;
}
/**
* Check that the user login name and password is correct.
*
* @since 0.71
* @todo xmlrpc only. Maybe move to xmlrpc.php.
*
* @param string $user_login User name.
* @param string $user_pass User password.
* @return bool False if does not authenticate, true if username and password authenticates.
*/
function user_pass_ok($user_login, $user_pass) {
$user = wp_authenticate($user_login, $user_pass);
if ( is_wp_error($user) )
return false;
return true;
}
//
// User option functions
//