if ( empty( $commentdata['comment_date_gmt'
] ) ) { $commentdata['comment_date_gmt'
] =
current_time( 'mysql', 1
);
} if ( empty( $commentdata['comment_type'
] ) ) { $commentdata['comment_type'
] = 'comment';
} $commentdata =
wp_filter_comment( $commentdata );
$commentdata['comment_approved'
] =
wp_allow_comment( $commentdata,
$wp_error );
if ( is_wp_error( $commentdata['comment_approved'
] ) ) { return $commentdata['comment_approved'
];
} $comment_id =
wp_insert_comment( $commentdata );
if ( !
$comment_id ) { $fields = array
( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content'
);
foreach ( $fields as $field ) {