[wp-trac] [WordPress Trac] #39732: Allowing wp_update_comment() to return WP_Error

WordPress Trac noreply at wordpress.org
Mon Feb 6 22:30:33 UTC 2017


#39732: Allowing wp_update_comment() to return WP_Error
--------------------------------------+--------------------
 Reporter:  enrico.sorcinelli         |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  4.8
Component:  Comments                  |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------

Comment (by jnylen0):

 In general I agree that enhancing `wp_update_comment` to return a
 `WP_Error` is a good idea.  However, as written, this would break a bunch
 of plugins and other code that relies on the current behavior.  Instead,
 we need to add a second parameter `$wp_error` that defaults to `false`.
 If it is `true` then we can use the newer, better return values.  @dd32
 started on a patch to do this:
 [https://core.trac.wordpress.org/attachment/ticket/38700/38700.wp-
 error.diff 38700.wp-error.diff]

 See also:

 - #38700, especially discussion around ticket:38700#comment:7
 - #39735

 Finally, we should make sure new code corresponds to the coding standards
 (braces around statements), but we don't want to change the existing code
 even if its formatting is not ideal.  This creates needless code churn and
 there are much more important tasks to be done:
 https://make.wordpress.org/core/handbook/contribute/code-refactoring/

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


More information about the wp-trac mailing list