From c68c3804fa7eefda05e3f1756b5954a3ff5f95b0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 29 Oct 2015 21:29:24 +0000 Subject: [PATCH] Correctly populate the `user_id` field for comments when a user submits a comment while logged in. Props imath Fixes #34493 Built from https://develop.svn.wordpress.org/trunk@35435 git-svn-id: http://core.svn.wordpress.org/trunk@35399 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-functions.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index 6b055d1d22..e1975f62e6 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -2742,6 +2742,7 @@ function wp_handle_comment_submission( $comment_data ) { $comment_author = $user->display_name; $comment_author_email = $user->user_email; $comment_author_url = $user->user_url; + $user_id = $user->ID; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $comment_data['_wp_unfiltered_html_comment'] ) || ! wp_verify_nonce( $comment_data['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID ) @@ -2778,7 +2779,7 @@ function wp_handle_comment_submission( $comment_data ) { 'comment_content', 'comment_type', 'comment_parent', - 'user_ID' + 'user_id' ); $comment_id = wp_new_comment( wp_slash( $commentdata ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5497a7668e..d6390e45b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta2-35434'; +$wp_version = '4.4-beta2-35435'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.