[wp-trac] [WordPress Trac] #39578: Enhancement for rest api comment controller create_item method to check for WP error

WordPress Trac noreply at wordpress.org
Tue Jan 17 05:17:17 UTC 2017


#39578: Enhancement for rest api comment controller create_item method to check for
WP error
-------------------------------------------------+-------------------------
 Reporter:  dspilka                              |       Owner:  rmccue
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  4.7.2
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  needs-unit-tests good-first-bug      |     Focuses:  rest-api
  has-patch                                      |
-------------------------------------------------+-------------------------
Changes (by rmccue):

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


Comment:

 In [changeset:"39922"]:
 {{{
 #!CommitTicketReference repository="" revision="39922"
 REST API: Allow shortcircuiting rest_pre_insert_comment

 rest_pre_insert_{post_type} allows returning a WP_Error from the filter to
 shortcircuit actually creating the object, so it makes sense to do so for
 comments too.

 Props dspilka.
 Fixes #39578.
 }}}

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


More information about the wp-trac mailing list