git-svn-id: http://svn.automattic.com/wordpress/trunk@16617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -583,14 +583,13 @@ case 'get-tagcloud' :
|
||||
case 'get-comments' :
|
||||
check_ajax_referer( $action );
|
||||
|
||||
$post_ID = (int) $_POST['post_ID'];
|
||||
if ( !current_user_can( 'edit_post', $post_ID ) )
|
||||
die('-1');
|
||||
|
||||
set_current_screen( 'edit-comments' );
|
||||
|
||||
$wp_list_table = get_list_table('WP_Post_Comments_List_Table');
|
||||
|
||||
if ( !current_user_can( 'edit_post', $post_id ) )
|
||||
die('-1');
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
if ( !$wp_list_table->has_items() )
|
||||
|
||||
@@ -206,7 +206,6 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
|
||||
<input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<?php submit_button( __( 'Search Comments' ), 'button', 'submit', false ); ?>
|
||||
</p>
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<?php if ( $post_id ) : ?>
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -21,11 +21,11 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
var $pending_count = array();
|
||||
|
||||
function WP_Comments_List_Table() {
|
||||
global $mode;
|
||||
global $post_id;
|
||||
|
||||
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'detail' : $_REQUEST['mode'];
|
||||
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
||||
|
||||
if ( get_option('show_avatars') && 'single' != $mode )
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
@@ -41,15 +41,6 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
function prepare_items() {
|
||||
global $post_id, $comment_status, $search;
|
||||
|
||||
if ( isset( $_REQUEST['p'] ) )
|
||||
$post_id = absint( $_REQUEST['p'] );
|
||||
elseif ( isset( $_REQUEST['post'] ) )
|
||||
$post_id = absint( $_REQUEST['post'] );
|
||||
elseif ( isset( $_REQUEST['post_ID'] ) )
|
||||
$post_id = absint( $_REQUEST['post_ID'] );
|
||||
else
|
||||
$post_id = 0;
|
||||
|
||||
$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
|
||||
if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
|
||||
$comment_status = 'all';
|
||||
@@ -232,7 +223,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
global $mode;
|
||||
global $post_id;
|
||||
|
||||
$columns = array();
|
||||
|
||||
@@ -242,7 +233,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
$columns['author'] = __( 'Author' );
|
||||
$columns['comment'] = _x( 'Comment', 'column name' );
|
||||
|
||||
if ( 'single' !== $mode )
|
||||
if ( !$post_id )
|
||||
$columns['response'] = _x( 'In Response To', 'column name' );
|
||||
|
||||
return $columns;
|
||||
|
||||
@@ -395,6 +395,7 @@ commentReply = {
|
||||
post.content = $('#replycontent').val();
|
||||
post.id = post.comment_post_ID;
|
||||
post.comments_listing = this.comments_listing;
|
||||
post.p = $('[name=p]').val();
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -171,7 +171,7 @@ commentsBox = {
|
||||
'action' : 'get-comments',
|
||||
'mode' : 'single',
|
||||
'_ajax_nonce' : $('#add_comment_nonce').val(),
|
||||
'post_ID' : $('#post_ID').val(),
|
||||
'p' : $('#post_ID').val(),
|
||||
'start' : st,
|
||||
'num' : num
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user