Skip to content

Conversation

schlessera
Copy link
Member

There seems to be a fundamental difference between get_user_by() and get_users(). Where the former creates a new WP_User object and initiates it via an array of data, the latter puts the actual database result into the WP_User's $data property via its constructor.

The end result is that the set of available properties is different. As an example, when a user is fetched via get_users(), it knows about its nickname. If it is fetched by get_user_by(), the nickname property does not exist.

This PR changes the UserFetcher to rely on get_users() (instead of get_user_by()), to make all properties available.

@schlessera schlessera requested a review from a team as a code owner January 13, 2022 05:04
@schlessera schlessera force-pushed the fix/use-proper-query-for-users branch from 0797006 to 5aa2197 Compare January 13, 2022 05:08
@schlessera schlessera added this to the 2.6.0 milestone Jan 13, 2022
@schlessera schlessera force-pushed the fix/use-proper-query-for-users branch from 1f17c67 to 5881e51 Compare January 13, 2022 06:24
@schlessera schlessera merged commit ae3cb73 into master Jan 13, 2022
@schlessera schlessera deleted the fix/use-proper-query-for-users branch January 13, 2022 07:15
schlessera added a commit that referenced this pull request Jan 25, 2022
…-users"

This reverts commit ae3cb73, reversing
changes made to 2c78dec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant