From 89fe0ff804e7c6497ebacc8b341ac89974f6f255 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 21 May 2007 18:37:58 +0000 Subject: WP Merge to rev 5499, this is a big one! Test it before you put it live! Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/admin-ajax.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'wp-admin/admin-ajax.php') diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 2ad2469..ad5064f 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -151,6 +151,31 @@ case 'add-cat' : // From Manage->Categories ) ); $x->send(); break; +case 'add-comment' : + if ( !current_user_can( 'edit_post', $id ) ) + die('-1'); + $search = isset($_POST['s']) ? $_POST['s'] : false; + $start = isset($_POST['page']) ? intval($_POST['page']) * 25 : 25; + + list($comments, $total) = _wp_get_comment_list( $search, $start, 1 ); + + if ( !$comments ) + die('1'); + $x = new WP_Ajax_Response(); + foreach ( (array) $comments as $comment ) { + get_comment( $comment ); + ob_start(); + _wp_comment_list_item( $comment->comment_ID ); + $comment_list_item = ob_get_contents(); + ob_end_clean(); + $x->add( array( + 'what' => 'comment', + 'id' => $comment->comment_ID, + 'data' => $comment_list_item + ) ); + } + $x->send(); + break; case 'add-meta' : if ( !current_user_can( 'edit_post', $id ) ) die('-1'); -- cgit