[wp-trac] [WordPress Trac] #56566: Fatal error when WP_REST_Server::dispatch() returns WP_Error

WordPress Trac noreply at wordpress.org
Fri Feb 17 15:44:01 UTC 2023


#56566: Fatal error when WP_REST_Server::dispatch() returns WP_Error
--------------------------------------+--------------------------------
 Reporter:  DaveFX                    |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.2
Component:  REST API                  |     Version:  4.4
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

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


Comment:

 In [changeset:"55361" 55361]:
 {{{
 #!CommitTicketReference repository="" revision="55361"
 REST API: Normalize WP_REST_Server::dispatch() to return a response
 object.

 Previously, the `rest_pre_dispatch` filter could be used to return a
 `WP_Error` instance. This would cause a fatal error for
 `rest_post_dispath`
 filters that were rightly expecting a `WP_REST_Response` object to be
 passed instead.

 Props DaveFX, felipeelia.
 Fixes #56566.
 }}}

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


More information about the wp-trac mailing list