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

git-svn-id: https://develop.svn.wordpress.org/trunk@9807 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2008-11-20 04:51:47 +00:00
parent f6e1881137
commit 99c24ed34b
6 changed files with 21 additions and 102 deletions

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