[wp-trac] [WordPress Trac] #44409: get_userdata and get_user_field_by

WordPress Trac noreply at wordpress.org
Wed Jun 20 09:16:09 UTC 2018


#44409: get_userdata and get_user_field_by
--------------------------+------------------------
 Reporter:  markuscode    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Users         |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Changes (by swissspidy):

 * status:  new => closed
 * resolution:   => duplicate
 * component:  General => Users
 * milestone:  Awaiting Review =>


Comment:

 Hey there

 No need to create a new ticket for that, a comment on #44392 would
 suffice.

 That being said, a function like `get_user_field_by` probably has no use
 case in core or in many plugins either.

 Even if you only need the user's email address I'd highly recommend you to
 use `get_userdata()`. Fetching a user this way will try to avoid querying
 the database directly when the user has already been requested before and
 is available either in memory or in the object cache.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44409#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list