From 1c00dc7150971fe511f35f0e18dccd1623917570 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 24 Feb 2016 00:48:52 +0000 Subject: [PATCH] Comments: Pass comment data to the `comment_post` filter. Props dshanske. See #34141. git-svn-id: https://develop.svn.wordpress.org/trunk@36660 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 3efefc59e3..450eae5d19 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -1812,11 +1812,13 @@ function wp_new_comment( $commentdata ) { * Fires immediately after a comment is inserted into the database. * * @since 1.2.0 + * @since 4.5.0 The `$commentdata` parameter was added. * * @param int $comment_ID The comment ID. * @param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam. + * @param array $commentdata Comment data. */ - do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'] ); + do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata ); return $comment_ID; }