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

WordPress Trac noreply at wordpress.org
Fri Oct 4 03:03:36 UTC 2019


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

Comment (by dlh):

 [attachment:"45677.12.diff"] has some updates based on the discussion
 above.

 - Remove the extra `private static $post_type_controllers`.
 - Make `$rest_controller` public.
 - Validate that `$this->rest_controller instanceof $class` before
 returning the controller, and add a couple related tests.

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


More information about the wp-trac mailing list