summaryrefslogtreecommitdiffstats
path: root/wp-admin/admin-ajax.php
diff options
context:
space:
mode:
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');