/** This filter is documented in wp-includes/comment.php */
$allow_empty =
apply_filters( 'allow_empty_comment', false,
$comment );
if ( !
$allow_empty && '' ===
$comment['comment_content'
] ) { return new IXR_Error( 403,
__( 'Comment is required.'
) );
} /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.newComment',
$args,
$this );
$comment_id =
wp_new_comment( $comment, true
);
if ( is_wp_error( $comment_id ) ) { return new IXR_Error( 403,
$comment_id->
get_error_message() );
} if ( !
$comment_id ) { return new IXR_Error( 403,
__( 'Something went wrong.'
) );
} /**
* Fires after a new comment has been successfully created via XML-RPC.
*
* @since 3.4.0
*
* @param int $comment_id ID of the new comment.
* @param array $args An array of new comment arguments.
*/