Make WordPress Core


Ignore:
Timestamp:
11/20/2008 04:51:47 AM (18 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit.php

    r9779 r9807  
    99/** WordPress Administration Bootstrap */
    1010require_once('admin.php');
     11
     12// Back-compat for viewing comments of an entry
     13if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) {
     14        wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
     15        exit;
     16} else {
     17        unset( $_redirect );
     18}
    1119
    1220// Handle bulk actions
     
    7381list($post_stati, $avail_post_stati) = wp_edit_posts_query();
    7482
    75 if ( 1 == count($posts) && is_singular() ) {
    76         wp_enqueue_script( 'admin-comments' );
    77         enqueue_comment_hotkeys_js();
    78 }
    79 
    8083require_once('admin-header.php');
    8184
     
    269272
    270273<br class="clear" />
    271 
    272 <?php
    273 
    274 if ( 1 == count($posts) && is_singular() ) :
    275 
    276         $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
    277         if ( $comments ) :
    278                 // Make sure comments, post, and post_author are cached
    279                 update_comment_cache($comments);
    280                 $post = get_post($id);
    281                 $authordata = get_userdata($post->post_author);
    282         ?>
    283 
    284 <br class="clear" />
    285 
    286 <table class="widefat fixed" cellspacing="0">
    287 <thead>
    288   <tr>
    289     <th scope="col" class="column-comment"><?php _e('Comment') ?></th>
    290     <th scope="col" class="column-author"><?php _e('Author') ?></th>
    291     <th scope="col" class="column-date"><?php _e('Submitted') ?></th>
    292   </tr>
    293 </thead>
    294 
    295 <tfoot>
    296   <tr>
    297     <th scope="col" class="column-comment"><?php _e('Comment') ?></th>
    298     <th scope="col" class="column-author"><?php _e('Author') ?></th>
    299     <th scope="col" class="column-date"><?php _e('Submitted') ?></th>
    300   </tr>
    301 </tfoot>
    302 
    303 <tbody id="the-comment-list" class="list:comment">
    304 <?php
    305         foreach ($comments as $comment)
    306                 _wp_comment_row( $comment->comment_ID, 'single', false, false );
    307 ?>
    308 </tbody>
    309 </table>
    310 
    311 <?php
    312 wp_comment_reply();
    313 endif; // comments
    314 endif; // posts;
    315 
    316 ?>
    317274
    318275</div>
Note: See TracChangeset for help on using the changeset viewer.