Make WordPress Core

Changeset 35948


Ignore:
Timestamp:
12/15/2015 03:12:50 PM (9 years ago)
Author:
rachelbaker
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r35902 r35948  
    14741474 *     @type int        $comment_parent       ID of this comment's parent, if any. Default 0.
    14751475 *     @type int        $comment_post_ID      ID of the post that relates to the comment, if any.
    1476  *                                            Default empty.
     1476 *                                            Default 0.
    14771477 *     @type string     $comment_type         Comment type. Default empty.
    14781478 *     @type array      $comment_meta         Optional. Array of key/value pairs to be stored in commentmeta for the
     
    14941494    $comment_date_gmt = ! isset( $data['comment_date_gmt'] ) ? get_gmt_from_date( $comment_date ) : $data['comment_date_gmt'];
    14951495
    1496     $comment_post_ID  = ! isset( $data['comment_post_ID'] )  ? '' : $data['comment_post_ID'];
     1496    $comment_post_ID  = ! isset( $data['comment_post_ID'] )  ? 0 : $data['comment_post_ID'];
    14971497    $comment_content  = ! isset( $data['comment_content'] )  ? '' : $data['comment_content'];
    14981498    $comment_karma    = ! isset( $data['comment_karma'] )    ? 0  : $data['comment_karma'];
Note: See TracChangeset for help on using the changeset viewer.