Make WordPress Core

Changeset 9807


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

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

Location:
trunk/wp-admin
Files:
6 edited

Legend:

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

    r8697 r9807  
    184184        wp_redirect( wp_get_referer() );
    185185    else
    186         wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
     186        wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
    187187
    188188    exit();
     
    209209        wp_redirect( wp_get_referer() );
    210210    else
    211         wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
     211        wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
    212212
    213213    exit();
     
    223223    edit_comment();
    224224
    225     $location = ( empty( $_POST['referredby'] ) ? "edit.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
     225    $location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
    226226    $location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
    227227    wp_redirect( $location );
  • trunk/wp-admin/edit-attachment-rows.php

    r9772 r9807  
    170170        if ( $left )
    171171            echo '<strong>';
    172         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>');
     172        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>');
    173173        if ( $left )
    174174            echo '</strong>';
  • trunk/wp-admin/edit-comments.php

    r9799 r9807  
    1010require_once('admin.php');
    1111
    12 $title = __('Edit Comments');
    1312wp_enqueue_script('admin-comments');
    1413enqueue_comment_hotkeys_js();
     
    6867}
    6968
     69$post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
     70
     71if ( $post_id )
     72    $title = sprintf(__('Edit Comments on &#8220;%s&#8221;'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
     73else
     74    $title = __('Edit Comments');
     75
    7076require_once('admin-header.php');
    7177
     
    7581
    7682$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : '';
    77 
    78 $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
    7983
    8084$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
  • 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>
  • trunk/wp-admin/includes/template.php

    r9788 r9807  
    14241424            if ( $pending_comments )
    14251425                echo '<strong>';
    1426                 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>');
     1426                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>');
    14271427                if ( $pending_comments )
    14281428                echo '</strong>';
     
    15751575        if ( $left )
    15761576            echo '<strong>';
    1577         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>');
     1577        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>');
    15781578        if ( $left )
    15791579            echo '</strong>';
  • trunk/wp-admin/upload.php

    r9746 r9807  
    135135} else {
    136136    list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
    137 }
    138 
    139 if ( is_singular() ) {
    140     wp_enqueue_script( 'admin-comments' );
    141     enqueue_comment_hotkeys_js();
    142137}
    143138
     
    410405<br class="clear" />
    411406
    412 <?php
    413 
    414 if ( 1 == count($posts) && is_singular() ) :
    415 
    416     $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
    417     if ( $comments ) :
    418         // Make sure comments, post, and post_author are cached
    419         update_comment_cache($comments);
    420         $post = get_post($id);
    421         $authordata = get_userdata($post->post_author);
    422     ?>
    423 
    424 <br class="clear" />
    425 
    426 <table class="widefat" cellspacing="0">
    427 <thead>
    428     <tr>
    429     <th scope="col" class="column-comment"><?php _e('Comment') ?></th>
    430     <th scope="col" class="column-author"><?php _e('Author') ?></th>
    431     <th scope="col" class="column-date"><?php _e('Submitted') ?></th>
    432   </tr>
    433 </thead>
    434 <tbody id="the-comment-list" class="list:comment">
    435 <?php
    436         foreach ($comments as $comment)
    437             _wp_comment_row( $comment->comment_ID, 'single', false, false );
    438 ?>
    439 </tbody>
    440 </table>
    441 
    442 <?php
    443 wp_comment_reply();
    444 endif; // comments
    445 endif; // posts;
    446 
    447 ?>
    448 
    449407</div>
    450408
Note: See TracChangeset for help on using the changeset viewer.