[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 03:21:25 UTC 2016


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

Comment (by jnylen0):

 I don't think that can be done easily, since `wp_update_comment` calls
 `wp_filter_comment` and `apply_filters( 'comment_save_pre' )`.  We'd have
 to duplicate all of this logic.

 If a plugin fires `edit_comment` before this code is triggered, this will
 work fine, because we're tracking the number of ''additional'' times it
 was called during `wp_update_comment`.

 If a plugin manages to fire `edit_comment` during `wp_update_comment`
 ''without updating the comment'', then that is an absurd thing to do, and
 we shouldn't expect it to work anyway.

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


More information about the wp-trac mailing list