summaryrefslogtreecommitdiffstats
path: root/wp-admin/admin-ajax.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
commit89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch)
tree3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-admin/admin-ajax.php
parenta139071806ba941346a109fbefb2d5f22bae1cc4 (diff)
downloadwordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip
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
Diffstat (limited to 'wp-admin/admin-ajax.php')
-rw-r--r--wp-admin/admin-ajax.php25
1 files changed, 25 insertions, 0 deletions
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');