Make WordPress Core


Ignore:
Timestamp:
10/01/2008 03:48:45 PM (16 years ago)
Author:
ryan
Message:

Comment type filter from Viper007Bond. see #7552

File:
1 edited

Legend:

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

    r9045 r9046  
    15321532}
    15331533
    1534 function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 ) {
     1534function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
    15351535    global $wpdb;
    15361536
     
    15521552    else
    15531553        $post = '';
     1554
     1555    if ( 'comment' == $type )
     1556        $typesql = "AND comment_type = ''";
     1557    elseif ( 'pingback' == $type )
     1558        $typesql = "AND comment_type = 'pingback'";
     1559    elseif ( 'trackback' == $type )
     1560        $typesql = "AND comment_type = 'trackback'";
     1561    else
     1562        $typesql = '';
    15541563
    15551564    if ( $s ) {
     
    15621571            comment_content LIKE ('%$s%') ) AND
    15631572            $approved
     1573            $typesql
    15641574            ORDER BY comment_date_gmt DESC LIMIT $start, $num");
    15651575    } else {
    1566         $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
     1576        $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved $post $typesql ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
    15671577    }
    15681578
Note: See TracChangeset for help on using the changeset viewer.