[wp-hackers] Patch to allow nested comments
Joris Aerts
joris at magicfly.nl
Sun Aug 27 18:34:18 GMT 2006
Hi,
For my blog I use nested comments. (example:
http://sillymidget.com/index.php/2006/07/10/dimensies-inbeelden-voor-dummies/#comments)
I can do everything with the template since wordpress already supports
parent_ID for comments for some reason. The only thing that's missing
are 2 lines in wp-comments-post.php that pass on the form data to the
wp_new_comment function (patch attached):
$comment_parent = (int) $_POST['comment_parent_ID'];
and
$commentdata = compact('comment_post_ID', 'comment_author',
'comment_author_email', 'comment_author_url', 'comment_content',
'comment_type', 'comment_parent', 'user_ID');
Maybe this can be commited to the svn repository?
Kind regards,
Joris
-------------- next part --------------
Index: wp-comments-post.php
===================================================================
--- wp-comments-post.php (revision 4118)
+++ wp-comments-post.php (working copy)
@@ -4,6 +4,7 @@
nocache_headers();
$comment_post_ID = (int) $_POST['comment_post_ID'];
+$comment_parent = (int) $_POST['comment_parent_ID'];
$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
@@ -46,7 +47,7 @@
if ( '' == $comment_content )
wp_die( __('Error: please type a comment.') );
-$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');
+$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
$comment_id = wp_new_comment( $commentdata );
@@ -61,4 +62,4 @@
wp_redirect( $location );
-?>
+?>
\ No newline at end of file
More information about the wp-hackers
mailing list