[wp-trac] [WordPress Trac] #39732: Allowing wp_update_comment() to return WP_Error
WordPress Trac
noreply at wordpress.org
Sun Jun 25 12:36:42 UTC 2017
#39732: Allowing wp_update_comment() to return WP_Error
-------------------------------------------------+-------------------------
Reporter: enrico.sorcinelli | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.9
Component: Comments | Version: 4.8
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses:
testing early |
-------------------------------------------------+-------------------------
Changes (by jnylen0):
* keywords: has-unit-tests needs-refresh => has-patch has-unit-tests
needs-testing early
* milestone: 4.8.1 => 4.9
Comment:
[attachment:39732.5.patch] generally looks good to me, though it needs
more testing and it should land early in a major release cycle.
I am not sure about this part, it seems like we probably need better error
handling here (and there is an extra space inside `wp_die (`):
{{{#!php
<?php
$result = wp_update_comment( $_POST, true );
if ( is_wp_error( $result ) ) {
wp_die ( $result->get_error_message() );
}
}}}
In general we need to be sure we understand all the ways existing behavior
will change as a result of this patch.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39732#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list