Make WordPress Core

Ticket #14841: edit-comments.diff

File edit-comments.diff, 1.7 KB (added by mintindeed, 15 years ago)

Comments search is global, so if this is a search remove the post id

  • wp-admin/edit-comments.php

     
    1515wp_enqueue_script('admin-comments');
    1616enqueue_comment_hotkeys_js();
    1717
     18$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
     19$search = esc_attr( $search_dirty );
     20
     21// Comments search is global, so if this is a search remove the post id
     22if ( !empty($search_dirty) ) {
     23        $_SERVER['REQUEST_URI'] = remove_query_arg('p', $_SERVER['REQUEST_URI']);
     24        unset($_REQUEST['p']);
     25}
     26
    1827$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
    1928
    2029if ( isset($_REQUEST['doaction']) ||  isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
     
    100109         exit;
    101110}
    102111
    103 if ( $post_id )
     112if ( $post_id && empty($search_dirty) )
    104113        $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
    105114else
    106115        $title = __('Comments');
     
    127136
    128137$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
    129138
    130 $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
    131 $search = esc_attr( $search_dirty ); ?>
     139?>
    132140
    133141<div class="wrap">
    134142<?php screen_icon(); ?>
     
    243251                $translated_label = _nx( $label[0], $label[1], $num_comments->$status, $label[2] );
    244252        else
    245253                $translated_label = _n( $label[0], $label[1], $num_comments->$status );
    246         $status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf( 
     254        $status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
    247255                $translated_label,
    248256                number_format_i18n( $num_comments->$status )
    249257        ) . '</a>';