[wp-trac] [WordPress Trac] #55857: Usage of wp_get_post_revisions in WP_REST_Posts_Controller

WordPress Trac noreply at wordpress.org
Fri May 27 15:04:02 UTC 2022


#55857: Usage of wp_get_post_revisions in WP_REST_Posts_Controller
-----------------------------------+-----------------------------
 Reporter:  furi3r                 |      Owner:  (none)
     Type:  enhancement            |     Status:  new
 Priority:  normal                 |  Milestone:  Awaiting Review
Component:  REST API               |    Version:
 Severity:  normal                 |   Keywords:
  Focuses:  rest-api, performance  |
-----------------------------------+-----------------------------
 I've come across this line of code:
 [https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes
 /rest-api/endpoints/class-wp-rest-posts-controller.php#L2020]

 We could optimize that query since wp_get_post_revisions accepts
 arguments, and we are going to use only the last revision, we could use
 LIMIT, instead of querying all of them.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55857>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list