Make WordPress Core


Ignore:
Timestamp:
09/28/2008 05:48:55 PM (17 years ago)
Author:
ryan
Message:

Post ID filter for edit-comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r9022 r9023  
    15301530}
    15311531
    1532 function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
     1532function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 ) {
    15331533    global $wpdb;
    15341534
    15351535    $start = abs( (int) $start );
    15361536    $num = (int) $num;
     1537    $post = (int) $post;
    15371538
    15381539    if ( 'moderated' == $status )
     
    15441545    else
    15451546        $approved = "( comment_approved = '0' OR comment_approved = '1' )";
     1547
     1548    if ( $post )
     1549        $post = " AND comment_post_ID = '$post'";
     1550    else
     1551        $post = '';
    15461552
    15471553    if ( $s ) {
     
    15561562            ORDER BY comment_date_gmt DESC LIMIT $start, $num");
    15571563    } else {
    1558         $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
     1564        $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
    15591565    }
    15601566
Note: See TracChangeset for help on using the changeset viewer.