From 719239ca1e1bd94bb6c93bc403af4a64fea77869 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Tue, 15 Dec 2015 15:13:27 +0000 Subject: [PATCH] Comments: Use an integer as the default value for `comment_post_ID` in `wp_insert_comment` to match database column. Props MikeHansenMe, juanfra, rabmalin. Fixes #34956 Built from https://develop.svn.wordpress.org/trunk@35948 git-svn-id: http://core.svn.wordpress.org/trunk@35912 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 50e2d29533..d6a6a00255 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1473,7 +1473,7 @@ function wp_get_current_commenter() { * @type int $comment_karma The karma of the comment. Default 0. * @type int $comment_parent ID of this comment's parent, if any. Default 0. * @type int $comment_post_ID ID of the post that relates to the comment, if any. - * Default empty. + * Default 0. * @type string $comment_type Comment type. Default empty. * @type array $comment_meta Optional. Array of key/value pairs to be stored in commentmeta for the * new comment. @@ -1493,7 +1493,7 @@ function wp_insert_comment( $commentdata ) { $comment_date = ! isset( $data['comment_date'] ) ? current_time( 'mysql' ) : $data['comment_date']; $comment_date_gmt = ! isset( $data['comment_date_gmt'] ) ? get_gmt_from_date( $comment_date ) : $data['comment_date_gmt']; - $comment_post_ID = ! isset( $data['comment_post_ID'] ) ? '' : $data['comment_post_ID']; + $comment_post_ID = ! isset( $data['comment_post_ID'] ) ? 0 : $data['comment_post_ID']; $comment_content = ! isset( $data['comment_content'] ) ? '' : $data['comment_content']; $comment_karma = ! isset( $data['comment_karma'] ) ? 0 : $data['comment_karma']; $comment_approved = ! isset( $data['comment_approved'] ) ? 1 : $data['comment_approved']; diff --git a/wp-includes/version.php b/wp-includes/version.php index c828ff5fb2..415d753732 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-35947'; +$wp_version = '4.5-alpha-35948'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.