mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-13 21:30:26 +00:00
Comments: Check if wp_new_comment() returns an error.
Adds checks throughout to allow for `wp_new_comment()` returning a `WP_Error` instance. Updates the docs for the `pre_comment_approved` filter to include that it can be passed an error. Props enrico.sorcinelli, ryotsun. Fixes #39730. git-svn-id: https://develop.svn.wordpress.org/trunk@41980 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -6487,6 +6487,10 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$comment_ID = wp_new_comment($commentdata);
|
||||
|
||||
if ( is_wp_error( $comment_ID ) ) {
|
||||
return $this->pingback_error( 0, $comment_ID->get_error_message() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after a post pingback has been sent.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user