Get rid of in favor of . Fixes #15607. See #15580

git-svn-id: http://svn.automattic.com/wordpress/trunk@16617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-11-29 20:15:04 +00:00
parent f2bad7cd38
commit 6eff593e14
8 changed files with 14 additions and 24 deletions

View File

@ -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() )

View File

@ -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; ?>

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -313,7 +313,7 @@ function wp_default_scripts( &$scripts ) {
'l10n_print_after' => 'try{convertEntities(listTableL10n);}catch(e){};'
) );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'list-table', 'jquery-ui-resizable', 'quicktags'), '20101121' );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'list-table', 'jquery-ui-resizable', 'quicktags'), '20101129' );
$scripts->add_data( 'admin-comments', 'group', 1 );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
@ -326,7 +326,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
$scripts->add_data( 'postbox', 'group', 1 );
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20101116' );
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20101129' );
$scripts->add_data( 'post', 'group', 1 );
$scripts->localize( 'post', 'postL10n', array(
'tagsUsed' => __('Tags used on this post:'),