Update phpdoc for get_user_to_edit(), get_userdata(), and get_user_by(). props tivnet. fixes #24992.

git-svn-id: https://develop.svn.wordpress.org/trunk@25204 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-09-02 03:24:33 +00:00
parent a276eeb68e
commit 6bef163456
2 changed files with 6 additions and 5 deletions

View File

@ -195,11 +195,12 @@ function get_editable_roles() {
* @since 2.0.5 * @since 2.0.5
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @return object WP_User object with user data. * @return WP_User|bool WP_User object on success, false on failure.
*/ */
function get_user_to_edit( $user_id ) { function get_user_to_edit( $user_id ) {
$user = get_userdata( $user_id ); $user = get_userdata( $user_id );
if ( $user )
$user->filter = 'edit'; $user->filter = 'edit';
return $user; return $user;

View File

@ -115,7 +115,7 @@ if ( !function_exists('get_userdata') ) :
* @since 0.71 * @since 0.71
* *
* @param int $user_id User ID * @param int $user_id User ID
* @return bool|object False on failure, WP_User object on success * @return WP_User|bool WP_User object on success, false on failure.
*/ */
function get_userdata( $user_id ) { function get_userdata( $user_id ) {
return get_user_by( 'id', $user_id ); return get_user_by( 'id', $user_id );
@ -130,7 +130,7 @@ if ( !function_exists('get_user_by') ) :
* *
* @param string $field The field to retrieve the user with. id | slug | email | login * @param string $field The field to retrieve the user with. id | slug | email | login
* @param int|string $value A value for $field. A user ID, slug, email address, or login name. * @param int|string $value A value for $field. A user ID, slug, email address, or login name.
* @return bool|object False on failure, WP_User object on success * @return WP_User|bool WP_User object on success, false on failure.
*/ */
function get_user_by( $field, $value ) { function get_user_by( $field, $value ) {
$userdata = WP_User::get_data_by( $field, $value ); $userdata = WP_User::get_data_by( $field, $value );
@ -463,7 +463,7 @@ if ( !function_exists('wp_authenticate') ) :
* *
* @param string $username User's username * @param string $username User's username
* @param string $password User's password * @param string $password User's password
* @return WP_Error|WP_User WP_User object if login successful, otherwise WP_Error object. * @return WP_User|WP_Error WP_User object if login successful, otherwise WP_Error object.
*/ */
function wp_authenticate($username, $password) { function wp_authenticate($username, $password) {
$username = sanitize_user($username); $username = sanitize_user($username);