[wp-trac] [WordPress Trac] #45677: REST Autosaves Controller creating extra instance of a post type REST controller

WordPress Trac noreply at wordpress.org
Mon Sep 23 20:25:11 UTC 2019


#45677: REST Autosaves Controller creating extra instance of a post type REST
controller
--------------------------------------+--------------------------------
 Reporter:  pat@…                     |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.3
Component:  REST API                  |     Version:  5.0
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+--------------------------------
Changes (by kadamwhite):

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


Comment:

 In [changeset:"46272" 46272]:
 {{{
 #!CommitTicketReference repository="" revision="46272"
 REST API: Introduce WP_Post_Type::get_rest_controller() caching method to
 prevent unnecessary REST controller construction.

 Cache REST controller references on their associated post type object to
 prevent unnecessary controller re-instantiation, which previously caused
 "rest_prepare_{$post_type}" and "rest_{$post_type}_query" to run twice per
 request.

 Props TimothyBlynJacobs, patrelentlesstechnologycom.
 Fixes #45677.
 }}}

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


More information about the wp-trac mailing list