From 1f9ce958f73a27a1915abe0c5a5bd6ca91a952cb Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 19 Sep 2012 01:35:35 +0000 Subject: [PATCH] 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 --- wp-includes/deprecated.php | 20 ++++++++++++++++++++ wp-includes/user.php | 18 ------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index da8bb1df26..77c26b0325 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -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; +} diff --git a/wp-includes/user.php b/wp-includes/user.php index a9ae2aa8b1..bee75d5e10 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -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 //