Make AJAX comment river post_id and comment_type aware

git-svn-id: http://svn.automattic.com/wordpress/trunk@10104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-12-07 07:31:27 +00:00
parent d64dc84e14
commit 19938ff3ee
2 changed files with 5 additions and 2 deletions

View File

@ -453,8 +453,9 @@ case 'add-comment' :
$start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 );
$p = isset($_POST['p']) ? $_POST['p'] : 0;
$comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';
list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1, $p, $comment_type );
if ( get_option('show_avatars') )
add_filter( 'comment_author', 'floated_admin_avatar' );

View File

@ -350,6 +350,8 @@ if ( $page_links )
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
<input type="hidden" name="p" value="<?php echo attribute_escape( $post_id ); ?>" />
<input type="hidden" name="comment_type" value="<?php echo attribute_escape( $comment_type ); ?>" />
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
</form>