[wp-trac] [WordPress Trac] #43680: Add new filter to WP_User_Query
WordPress Trac
noreply at wordpress.org
Tue Sep 25 00:01:50 UTC 2018
#43680: Add new filter to WP_User_Query
-------------------------------------+-----------------------------
Reporter: spacedmonkey | Owner: SergeyBiryukov
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 4.9.9
Component: Users | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [ticket:43680 spacedmonkey]:
> Add a new filter to filter the value of results returned from the
WP_User_Query. This brings the WP_User_Query class inline with other query
classes, like WP_Query, which already has `posts_results` filter.
For consistency with the `posts_results` filter, which accepts an array of
`WP_Post` objects rather than `stdClass` objects, I guess I would expect
`users_results` to accept an array of `WP_User` objects.
What do you think of [attachment:"43680.3.diff"]? It runs the filter a bit
later, after converting the results to `WP_User` objects when `fields` is
`all` or `all_with_meta`, but before retrieving metadata via
`cache_users()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43680#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list