Title: get_user_by
Published: April 25, 2014
Last modified: April 28, 2025

---

# get_user_by( string $field, int|string $value ): 󠀁[WP_User](https://developer.wordpress.org/reference/classes/wp_user/)󠁿|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#wp--skip-link--target)

Retrieves user info by a given field.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#parameters)󠁿

 `$field`stringrequired

The field to retrieve the user with. id | ID | slug | email | login.

`$value`int|stringrequired

A value for $field. A user ID, slug, email address, or login name.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#return)󠁿

 [WP_User](https://developer.wordpress.org/reference/classes/wp_user/)|false [WP_User](https://developer.wordpress.org/reference/classes/wp_user/)
object on success, false on failure.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#source)󠁿

    ```php
    function get_user_by( $field, $value ) {
    	$userdata = WP_User::get_data_by( $field, $value );

    	if ( ! $userdata ) {
    		return false;
    	}

    	$user = new WP_User();
    	$user->init( $userdata );

    	return $user;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/pluggable.php#L101)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/pluggable.php#L101-L112)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_User::get_data_by()](https://developer.wordpress.org/reference/classes/wp_user/get_data_by/)`wp-includes/class-wp-user.php` |

Returns only the main user fields.

  | 
| [WP_User::__construct()](https://developer.wordpress.org/reference/classes/wp_user/__construct/)`wp-includes/class-wp-user.php` |

Constructor.

  |

| Used by | Description | 
| [get_user()](https://developer.wordpress.org/reference/functions/get_user/)`wp-includes/user.php` |

Retrieves user info by user ID.

  | 
| [WP_REST_Templates_Controller::get_wp_templates_author_text_field()](https://developer.wordpress.org/reference/classes/wp_rest_templates_controller/get_wp_templates_author_text_field/)`wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php` |

Returns a human readable text for the author of the template.

  | 
| [wpmu_new_site_admin_notification()](https://developer.wordpress.org/reference/functions/wpmu_new_site_admin_notification/)`wp-includes/ms-functions.php` |

Notifies the Multisite network administrator that a new site was created.

  | 
| [wp_authenticate_application_password()](https://developer.wordpress.org/reference/functions/wp_authenticate_application_password/)`wp-includes/user.php` |

Authenticates the user using an application password.

  | 
| [WP_Automatic_Updater::send_plugin_theme_email()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/send_plugin_theme_email/)`wp-admin/includes/class-wp-automatic-updater.php` |

Sends an email upon the completion or failure of a plugin or theme background update.

  | 
| [populate_network_meta()](https://developer.wordpress.org/reference/functions/populate_network_meta/)`wp-admin/includes/schema.php` |

Creates WordPress network meta and sets the default values.

  | 
| [get_object_subtype()](https://developer.wordpress.org/reference/functions/get_object_subtype/)`wp-includes/meta.php` |

Returns the object subtype for a given object ID of a specific type.

  | 
| [wp_create_user_request()](https://developer.wordpress.org/reference/functions/wp_create_user_request/)`wp-includes/user.php` |

Creates and logs a user request to perform a specific action.

  | 
| [wp_user_personal_data_exporter()](https://developer.wordpress.org/reference/functions/wp_user_personal_data_exporter/)`wp-includes/user.php` |

Finds and exports personal data associated with an email address from the user and user_meta table.

  | 
| [wp_media_personal_data_exporter()](https://developer.wordpress.org/reference/functions/wp_media_personal_data_exporter/)`wp-includes/media.php` |

Finds and exports attachments associated with an email address.

  | 
| [_wp_personal_data_handle_actions()](https://developer.wordpress.org/reference/functions/_wp_personal_data_handle_actions/)`wp-admin/includes/privacy-tools.php` |

Handle list table actions.

  | 
| [get_user_locale()](https://developer.wordpress.org/reference/functions/get_user_locale/)`wp-includes/l10n.php` |

Retrieves the locale of a user.

  | 
| [WP_REST_Users_Controller::create_item()](https://developer.wordpress.org/reference/classes/wp_rest_users_controller/create_item/)`wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php` |

Creates a single user.

  | 
| [WP_REST_Users_Controller::update_item()](https://developer.wordpress.org/reference/classes/wp_rest_users_controller/update_item/)`wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php` |

Updates a single user.

  | 
| [wp_authenticate_email_password()](https://developer.wordpress.org/reference/functions/wp_authenticate_email_password/)`wp-includes/user.php` |

Authenticates a user using the email and password.

  | 
| [get_avatar_data()](https://developer.wordpress.org/reference/functions/get_avatar_data/)`wp-includes/link-template.php` |

Retrieves default data about the avatar.

  | 
| [retrieve_password()](https://developer.wordpress.org/reference/functions/retrieve_password/)`wp-includes/user.php` |

Handles sending a password retrieval email to a user.

  | 
| [WP_Automatic_Updater::send_email()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/send_email/)`wp-admin/includes/class-wp-automatic-updater.php` |

Sends an email upon the completion or failure of a background core update.

  | 
| [WP_Automatic_Updater::send_debug_email()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/send_debug_email/)`wp-admin/includes/class-wp-automatic-updater.php` |

Prepares and sends an email of a full log of background update results, useful for debugging and geekery.

  | 
| [wp_password_change_notification()](https://developer.wordpress.org/reference/functions/wp_password_change_notification/)`wp-includes/pluggable.php` |

Notifies the blog admin of a user changing password, normally via email.

  | 
| [wp_new_user_notification()](https://developer.wordpress.org/reference/functions/wp_new_user_notification/)`wp-includes/pluggable.php` |

Emails login credentials to a newly-registered user.

  | 
| [wp_notify_postauthor()](https://developer.wordpress.org/reference/functions/wp_notify_postauthor/)`wp-includes/pluggable.php` |

Notifies an author (and/or others) of a comment/trackback/pingback on a post.

  | 
| [wp_notify_moderator()](https://developer.wordpress.org/reference/functions/wp_notify_moderator/)`wp-includes/pluggable.php` |

Notifies the moderator of the site about a new comment that is awaiting approval.

  | 
| [wp_validate_auth_cookie()](https://developer.wordpress.org/reference/functions/wp_validate_auth_cookie/)`wp-includes/pluggable.php` |

Validates authentication cookie.

  | 
| [get_userdata()](https://developer.wordpress.org/reference/functions/get_userdata/)`wp-includes/pluggable.php` |

Retrieves user info by user ID.

  | 
| [get_profile()](https://developer.wordpress.org/reference/functions/get_profile/)`wp-includes/deprecated.php` |

Retrieve user data based on field.

  | 
| [WP_Query::get_queried_object()](https://developer.wordpress.org/reference/classes/wp_query/get_queried_object/)`wp-includes/class-wp-query.php` |

Retrieves the currently queried object.

  | 
| [WP_Query::get_posts()](https://developer.wordpress.org/reference/classes/wp_query/get_posts/)`wp-includes/class-wp-query.php` |

Retrieves an array of posts based on query variables.

  | 
| [check_password_reset_key()](https://developer.wordpress.org/reference/functions/check_password_reset_key/)`wp-includes/user.php` |

Retrieves a user row based on password reset key and login.

  | 
| [username_exists()](https://developer.wordpress.org/reference/functions/username_exists/)`wp-includes/user.php` |

Determines whether the given username exists.

  | 
| [email_exists()](https://developer.wordpress.org/reference/functions/email_exists/)`wp-includes/user.php` |

Determines whether the given email exists.

  | 
| [wp_authenticate_username_password()](https://developer.wordpress.org/reference/functions/wp_authenticate_username_password/)`wp-includes/user.php` |

Authenticates a user, confirming the username and password are valid.

  | 
| [get_userdatabylogin()](https://developer.wordpress.org/reference/functions/get_userdatabylogin/)`wp-includes/pluggable-deprecated.php` |

Retrieve user info by login name.

  | 
| [get_user_by_email()](https://developer.wordpress.org/reference/functions/get_user_by_email/)`wp-includes/pluggable-deprecated.php` |

Retrieve user info by email.

  | 
| [wp_setcookie()](https://developer.wordpress.org/reference/functions/wp_setcookie/)`wp-includes/pluggable-deprecated.php` |

Sets a cookie for a user who just logged in. This function is deprecated.

  | 
| [get_pages()](https://developer.wordpress.org/reference/functions/get_pages/)`wp-includes/post.php` |

Retrieves an array of pages (or hierarchical post type items).

  | 
| [is_user_spammy()](https://developer.wordpress.org/reference/functions/is_user_spammy/)`wp-includes/ms-functions.php` |

Determines whether a user is marked as a spammer, based on user login.

  | 
| [wpmu_signup_blog_notification()](https://developer.wordpress.org/reference/functions/wpmu_signup_blog_notification/)`wp-includes/ms-functions.php` |

Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active until the confirmation link is clicked.

  | 
| [wpmu_signup_user_notification()](https://developer.wordpress.org/reference/functions/wpmu_signup_user_notification/)`wp-includes/ms-functions.php` |

Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site at the same time). The user account will not become active until the confirmation link is clicked.

  | 
| [is_site_admin()](https://developer.wordpress.org/reference/functions/is_site_admin/)`wp-includes/ms-deprecated.php` |

Determine if user is a site admin.

  | 
| [get_user_details()](https://developer.wordpress.org/reference/functions/get_user_details/)`wp-includes/ms-deprecated.php` |

Deprecated functionality to retrieve user information.

  | 
| [get_user_id_from_string()](https://developer.wordpress.org/reference/functions/get_user_id_from_string/)`wp-includes/ms-deprecated.php` |

Get a numeric user ID from either an email address or a login.

  | 
| [check_comment()](https://developer.wordpress.org/reference/functions/check_comment/)`wp-includes/comment.php` |

Checks whether a comment passes internal checks to be allowed to add.

  |

[Show 38 more](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Added `'ID'` as an alias of `'id'` for the `$field` parameter. | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 8 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-495)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-495)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-495)
     Vote results for this note: 20[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-495)
 4.  Sample response of
 5.      ```php
         $author_obj = get_user_by('id', 1);
         ```
     
 6.  `
      object(WP_User)#96 (7) { ["data"]=> object(stdClass)#95 (10) { ["ID"]=> string(
     1) "1" ["user_login"]=> string(10) "superadmin" ["user_pass"]=> string(34) "$P
     $Bx0Jgq6/Qw/o3A5fXcVKg4jxQr2PAB1" ["user_nicename"]=> string(10) "superadmin" ["
     user_email"]=> string(16) "user@example.com" ["user_url"]=> string(0) "" ["user_registered"]
     => string(19) "2014-02-21 21:31:40" ["user_activation_key"]=> string(0) "" ["user_status"]
     => string(1) "0" ["display_name"]=> string(10) "superadmin" } ["ID"]=> int(1) ["
     caps"]=> array(1) { ["administrator"]=> bool(true) } ["cap_key"]=> string(25) "
     wp_capabilities" ["roles"]=> array(1) { [0]=> string(13) "administrator" } ["allcaps"]
     => array(63) { ["switch_themes"]=> bool(true) ["edit_themes"]=> bool(true) ["activate_plugins"]
     => bool(true) ["edit_plugins"]=> bool(true) ["edit_users"]=> bool(true) ["edit_files"]
     => bool(true) ["manage_options"]=> bool(true) ["moderate_comments"]=> bool(true)["
     manage_categories"]=> bool(true) ["manage_links"]=> bool(true) ["upload_files"]
     => bool(true) ["import"]=> bool(true) ["unfiltered_html"]=> bool(true) ["edit_posts"]
     => bool(true) ["edit_others_posts"]=> bool(true) ["edit_published_posts"]=> bool(
     true) ["publish_posts"]=> bool(true) ["edit_pages"]=> bool(true) ["read"]=> bool(
     true) ["level_10"]=> bool(true) ["level_9"]=> bool(true) ["level_8"]=> bool(true)["
     level_7"]=> bool(true) ["level_6"]=> bool(true) ["level_5"]=> bool(true) ["level_4"]
     => bool(true) ["level_3"]=> bool(true) ["level_2"]=> bool(true) ["level_1"]=> 
     bool(true) ["level_0"]=> bool(true) ["edit_others_pages"]=> bool(true) ["edit_published_pages"]
     => bool(true) ["publish_pages"]=> bool(true) ["delete_pages"]=> bool(true) ["delete_others_pages"]
     => bool(true) ["delete_published_pages"]=> bool(true) ["delete_posts"]=> bool(
     true) ["delete_others_posts"]=> bool(true) ["delete_published_posts"]=> bool(true)["
     delete_private_posts"]=> bool(true) ["edit_private_posts"]=> bool(true) ["read_private_posts"]
     => bool(true) ["delete_private_pages"]=> bool(true) ["edit_private_pages"]=> bool(
     true) ["read_private_pages"]=> bool(true) ["delete_users"]=> bool(true) ["create_users"]
     => bool(true) ["unfiltered_upload"]=> bool(true) ["edit_dashboard"]=> bool(true)["
     update_plugins"]=> bool(true) ["delete_plugins"]=> bool(true) ["install_plugins"]
     => bool(true) ["update_themes"]=> bool(true) ["install_themes"]=> bool(true) ["
     update_core"]=> bool(true) ["list_users"]=> bool(true) ["remove_users"]=> bool(
     true) ["add_users"]=> bool(true) ["promote_users"]=> bool(true) ["edit_theme_options"]
     => bool(true) ["delete_themes"]=> bool(true) ["export"]=> bool(true) ["administrator"]
     => bool(true) } ["filter"]=> NULL }
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D495%23feedback-editor-495)
 8.   [Skip to note 9 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-494)
 9.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-494)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-494)
     Vote results for this note: 18[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-494)
 11. **Default usage**
 12.     ```php
         $user = get_user_by( 'email', 'user@example.com' );
         echo 'User is ' . $user->first_name . ' ' . $user->last_name;
         ```
     
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D494%23feedback-editor-494)
 14.  [Skip to note 10 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-1707)
 15.   [Joseph G.](https://profiles.wordpress.org/dunhakdis/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-1707)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-1707)
     Vote results for this note: 5[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-1707)
 17. I always prefer to check if the variable ($user) is empty or not before echoing
     any properties of the $user object:
 18. $user = get_user_by( ’email’, ‘user@example.com’ );
 19. if ( ! empty( $user ) ) {
      echo ‘User is ‘ . $user->first_name . ‘ ‘ . $user->
     last_name; }
 20. This is to keep things clean and prevent error messages and warnings.
 21.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D1707%23feedback-editor-1707)
 22.  [Skip to note 11 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-2504)
 23.   [Jino MB](https://profiles.wordpress.org/mukeshmb/)  [  8 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-2504)
 24. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-2504)
     Vote results for this note: 2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-2504)
 25.  If you want to get the user id from user loginname.
 26.     ```php
         $user = get_user_by('login','loginname');
         if($user)
         {
            echo $user-&gt;ID;
         }
         ```
     
 27.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D2504%23feedback-editor-2504)
 28.  [Skip to note 12 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-3124)
 29.   [destabilizator](https://profiles.wordpress.org/destabilizator/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-3124)
 30. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-3124)
     Vote results for this note: 2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-3124)
 31. To obtain user’s email via this, you have to use “user_email” property, not just“
     email”.
 32. `$user = get_user_by('login', $username);
      if ($user) { $details['name'] = $user-
     >first_name . ' ' . $user->last_name; $details['email'] = $user->user_email; };
 33.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D3124%23feedback-editor-3124)
 34.  [Skip to note 13 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-2493)
 35.   [zackcarlson](https://profiles.wordpress.org/zackcarlson/)  [  8 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-2493)
 36. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-2493)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-2493)
 37.     ```php
         get_user_by('login', $user_login)
         ```
     
 38.  is case sensitive. Which means
 39.     ```php
         get_user_by('login', "UserName")
         ```
     
 40.  would not match any users with like
 41.     ```php
         "username"
         ```
     
 42.  * It looks like this is no longer case sensitive on at least the `login` or `
        email` search options.
      * [Wade](https://profiles.wordpress.org/wadedeveloper/) [4 years ago](https://developer.wordpress.org/reference/functions/get_user_by/#comment-6097)
 43.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D2493%23feedback-editor-2493)
 44.  [Skip to note 14 content](https://developer.wordpress.org/reference/functions/get_user_by/?output_format=md#comment-content-5591)
 45.   [Ahmad Ali](https://profiles.wordpress.org/aallii300300/)  [  4 years ago  ](https://developer.wordpress.org/reference/functions/get_user_by/#comment-5591)
 46. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-5591)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%23comment-5591)
 47. ** Find user by id / email / username **
 48.     ```php
         $new_member_id = $_POST['new_member_id'];
         $u = null;
     
         if (intval($new_member_id)) $u = get_user_by('id', $new_member_id);
         else if (strpos($new_member_id, '@') != false) $u = get_user_by('email', $new_member_id);
         else $u = get_user_by('login', $new_member_id);
         ```
     
 49.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F%3Freplytocom%3D5591%23feedback-editor-5591)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_user_by%2F)
before being able to contribute a note or feedback.