[wp-trac] [WordPress Trac] #38700: REST API: Cannot send an empty or no-op comment update

WordPress Trac noreply at wordpress.org
Tue Nov 8 06:16:59 UTC 2016


#38700: REST API: Cannot send an empty or no-op comment update
------------------------------------------------+--------------------------
 Reporter:  jnylen0                             |       Owner:  rmccue
     Type:  defect (bug)                        |      Status:  assigned
 Priority:  normal                              |   Milestone:  Future
Component:  REST API                            |  Release
 Severity:  normal                              |     Version:  trunk
 Keywords:  has-patch has-unit-tests 4.8-early  |  Resolution:
                                                |     Focuses:
------------------------------------------------+--------------------------

Comment (by dd32):

 I think this could also be changed from `return 0;` to `return false;` in
 addition to, or in place of, adding a `$wp_error`.

 The two `return 0`'s were seemingly added due to the function doc
 specifying 1 = success, 0 = failure, which was only because it returned
 the number of rows affected.
 I know it'd technically be a BC change, but given WordPress really doesn't
 encourage strict type checking for falsey values I think that'd be a
 viable option here.

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


More information about the wp-trac mailing list