Repoint and redirect edit.php?p=X to edit-comments.php?p=X

git-svn-id: http://svn.automattic.com/wordpress/trunk@9807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-11-20 04:51:47 +00:00
parent 481f264e04
commit 821218975c
6 changed files with 21 additions and 102 deletions

View File

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

View File

@ -169,7 +169,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
if ( $left )
echo '<strong>';
comments_number("<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
if ( $left )
echo '</strong>';
?>

View File

@ -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 &#8220;%s&#8221;'), 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 ); ?>

View File

@ -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 )
<br class="clear" />
<?php
if ( 1 == count($posts) && is_singular() ) :
$comments = $wpdb->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);
?>
<br class="clear" />
<table class="widefat fixed" cellspacing="0">
<thead>
<tr>
<th scope="col" class="column-comment"><?php _e('Comment') ?></th>
<th scope="col" class="column-author"><?php _e('Author') ?></th>
<th scope="col" class="column-date"><?php _e('Submitted') ?></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="column-comment"><?php _e('Comment') ?></th>
<th scope="col" class="column-author"><?php _e('Author') ?></th>
<th scope="col" class="column-date"><?php _e('Submitted') ?></th>
</tr>
</tfoot>
<tbody id="the-comment-list" class="list:comment">
<?php
foreach ($comments as $comment)
_wp_comment_row( $comment->comment_ID, 'single', false, false );
?>
</tbody>
</table>
<?php
wp_comment_reply();
endif; // comments
endif; // posts;
?>
</div>
<script type="text/javascript">

View File

@ -1423,7 +1423,7 @@ function _post_row($a_post, $pending_comments, $mode) {
$pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
if ( $pending_comments )
echo '<strong>';
comments_number("<a href='edit.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
if ( $pending_comments )
echo '</strong>';
?>
@ -1574,7 +1574,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
if ( $left )
echo '<strong>';
comments_number("<a href='edit-comments.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
if ( $left )
echo '</strong>';
?>

View File

@ -136,11 +136,6 @@ if ( isset($_GET['detached']) ) {
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
}
if ( is_singular() ) {
wp_enqueue_script( 'admin-comments' );
enqueue_comment_hotkeys_js();
}
require_once('admin-header.php'); ?>
<?php
@ -409,43 +404,6 @@ if ( $page_links )
</form>
<br class="clear" />
<?php
if ( 1 == count($posts) && is_singular() ) :
$comments = $wpdb->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);
?>
<br class="clear" />
<table class="widefat" cellspacing="0">
<thead>
<tr>
<th scope="col" class="column-comment"><?php _e('Comment') ?></th>
<th scope="col" class="column-author"><?php _e('Author') ?></th>
<th scope="col" class="column-date"><?php _e('Submitted') ?></th>
</tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
foreach ($comments as $comment)
_wp_comment_row( $comment->comment_ID, 'single', false, false );
?>
</tbody>
</table>
<?php
wp_comment_reply();
endif; // comments
endif; // posts;
?>
</div>
<script type="text/javascript">