Make WordPress Core


Ignore:
Timestamp:
03/05/2015 02:59:47 AM (10 years ago)
Author:
boonebgorges
Message:

Respect comment_date and comment_date_gmt params in wp_new_comment().

Props solarissmoke, oso96_2000.
Fixes #14279.

File:
1 edited

Legend:

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

    r31553 r31615  
    22132213    $commentdata['comment_agent']     = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '';
    22142214
    2215     $commentdata['comment_date']     = current_time('mysql');
    2216     $commentdata['comment_date_gmt'] = current_time('mysql', 1);
     2215    if ( empty( $commentdata['comment_date'] ) ) {
     2216        $commentdata['comment_date'] = current_time('mysql');
     2217    }
     2218
     2219    if ( empty( $commentdata['comment_date_gmt'] ) ) {
     2220        $commentdata['comment_date_gmt'] = current_time( 'mysql', 1 );
     2221    }
    22172222
    22182223    $commentdata = wp_filter_comment($commentdata);
Note: See TracChangeset for help on using the changeset viewer.