[wp-trac] [WordPress Trac] #40580: rest_ensure_response() can return WP_Error object, but is consequently not checked in get_item() method

WordPress Trac noreply at wordpress.org
Wed May 3 11:58:15 UTC 2017


#40580: rest_ensure_response() can return WP_Error object, but is consequently not
checked in get_item() method
-------------------------------------------------+-------------------------
 Reporter:  ruud@…                               |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  REST API                             |  Review
 Severity:  normal                               |     Version:  4.7
 Keywords:  has-patch dev-feedback needs-unit-   |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by ruud@…):

 Hi James,

 I managed to get the job done via extending the WP_REST_Posts_Controller
 class and using my own custom class to add the desired additional check in
 the get_item() method.

 Thanks,
 Ruud

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


More information about the wp-trac mailing list