mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Respect comment_date and comment_date_gmt params in wp_new_comment().
Props solarissmoke, oso96_2000. Fixes #14279. git-svn-id: https://develop.svn.wordpress.org/trunk@31615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2212,8 +2212,13 @@ function wp_new_comment( $commentdata ) {
|
||||
$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
|
||||
$commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '';
|
||||
|
||||
$commentdata['comment_date'] = current_time('mysql');
|
||||
$commentdata['comment_date_gmt'] = current_time('mysql', 1);
|
||||
if ( empty( $commentdata['comment_date'] ) ) {
|
||||
$commentdata['comment_date'] = current_time('mysql');
|
||||
}
|
||||
|
||||
if ( empty( $commentdata['comment_date_gmt'] ) ) {
|
||||
$commentdata['comment_date_gmt'] = current_time( 'mysql', 1 );
|
||||
}
|
||||
|
||||
$commentdata = wp_filter_comment($commentdata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user