[wp-trac] [WordPress Trac] #49118: REST API: minor performance improvement for /wp/v2/users?who=authors

WordPress Trac noreply at wordpress.org
Fri Jan 3 02:26:48 UTC 2020


#49118: REST API: minor performance improvement for /wp/v2/users?who=authors
------------------------------+-----------------------------
 Reporter:  pbiron            |       Owner:  SergeyBiryukov
     Type:  enhancement       |      Status:  closed
 Priority:  normal            |   Milestone:  5.4
Component:  Users             |     Version:  4.9.6
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  rest-api
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"47034" 47034]:
 {{{
 #!CommitTicketReference repository="" revision="47034"
 REST API: Synchronize permission checks in
 `::get_items_permissions_check()` methods for post types, post statuses,
 and users:

 * Only query post types with `'show_in_rest' => true` instead of looping
 over all post types and checking the `show_in_rest` property separately.
 * Return from the `foreach()` loop as soon as the permission check
 succeeded.

 Props pbiron, TimothyBlynJacobs, SergeyBiryukov.
 Fixes #49118.
 }}}

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


More information about the wp-trac mailing list