diff --git a/wp-admin/comment.php b/wp-admin/comment.php index eb9bf6dd0..6ff0c2cfb 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -183,7 +183,7 @@ case 'unapprovecomment' : if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else - wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); + wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); exit(); break; @@ -208,7 +208,7 @@ case 'approvecomment' : if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else - wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); + wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); exit(); break; @@ -222,7 +222,7 @@ case 'editedcomment' : edit_comment(); - $location = ( empty( $_POST['referredby'] ) ? "edit.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; + $location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); wp_redirect( $location ); diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 6b5cffae8..9b9afc7a3 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -169,7 +169,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); if ( $left ) echo ''; ?> diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index a4ba29017..5059631a0 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -9,7 +9,6 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); -$title = __('Edit Comments'); wp_enqueue_script('admin-comments'); enqueue_comment_hotkeys_js(); @@ -67,6 +66,13 @@ if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spa exit; } +$post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0; + +if ( $post_id ) + $title = sprintf(__('Edit Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); +else + $title = __('Edit Comments'); + require_once('admin-header.php'); $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']); @@ -75,8 +81,6 @@ $comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comm $comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : ''; -$post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0; - $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; $search = attribute_escape( $search_dirty ); ?> diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 0a41f1c15..9a05c7dd6 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -9,6 +9,14 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); +// Back-compat for viewing comments of an entry +if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) { + wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) ); + exit; +} else { + unset( $_redirect ); +} + // Handle bulk actions if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; @@ -72,11 +80,6 @@ wp_enqueue_script('inline-edit-post'); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); -if ( 1 == count($posts) && is_singular() ) { - wp_enqueue_script( 'admin-comments' ); - enqueue_comment_hotkeys_js(); -} - require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) @@ -269,52 +272,6 @@ if ( $page_links )
-get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); - if ( $comments ) : - // Make sure comments, post, and post_author are cached - update_comment_cache($comments); - $post = get_post($id); - $authordata = get_userdata($post->post_author); - ?> - -
- - - - - - - - - - - - - - - - - - - -comment_ID, 'single', false, false ); -?> - -
- - -