mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-08 03:00:14 +00:00
Comment registration goodness. Hat tip to Jason at noprequisite.com for user_identity code.
git-svn-id: https://develop.svn.wordpress.org/trunk@2166 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -429,6 +429,7 @@ function wp_new_comment( $commentdata, $spam = false ) {
|
||||
|
||||
$comment_post_ID = (int) $comment_post_ID;
|
||||
|
||||
$user_id = apply_filters('pre_user_id', $user_ID);
|
||||
$author = apply_filters('pre_comment_author_name', $comment_author);
|
||||
$email = apply_filters('pre_comment_author_email', $comment_author_email);
|
||||
$url = apply_filters('pre_comment_author_url', $comment_author_url);
|
||||
@@ -463,9 +464,9 @@ function wp_new_comment( $commentdata, $spam = false ) {
|
||||
$approved = apply_filters('pre_comment_approved', $approved);
|
||||
|
||||
$result = $wpdb->query("INSERT INTO $wpdb->comments
|
||||
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type)
|
||||
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, user_id)
|
||||
VALUES
|
||||
('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved', '$user_agent', '$comment_type')
|
||||
('$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$now_gmt', '$comment', '$approved', '$user_agent', '$comment_type', '$user_id')
|
||||
");
|
||||
|
||||
$comment_id = $wpdb->insert_id;
|
||||
|
||||
Reference in New Issue
Block a user