Make WordPress Core

Changeset 11748


Ignore:
Timestamp:
07/27/2009 11:28:13 PM (15 years ago)
Author:
azaozz
Message:

Allow _wp_get_comment_list to handle custom comment types, props aaroncampbell, fixes #10463

File:
1 edited

Legend:

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

    r11743 r11748  
    19821982 * @since unknown
    19831983 *
    1984  * @param unknown_type $status
    1985  * @param unknown_type $s
    1986  * @param unknown_type $start
    1987  * @param unknown_type $num
    1988  * @param unknown_type $post
    1989  * @param unknown_type $type
    1990  * @return unknown
     1984 * @param string $status Comment status (approved, spam, deleted, etc)
     1985 * @param string $s Term to search for
     1986 * @param int $start Offset to start at for pagination
     1987 * @param int $num Maximum number of comments to return
     1988 * @param int $post Post ID or 0 to return all comments
     1989 * @param string $type Comment type (comment, trackback, pingback, etc)
     1990 * @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num)
    19911991 */
    19921992function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
     
    20282028    if ( 'comment' == $type )
    20292029        $typesql = "AND comment_type = ''";
    2030     elseif ( 'pingback' == $type )
    2031         $typesql = "AND comment_type = 'pingback'";
    2032     elseif ( 'trackback' == $type )
    2033         $typesql = "AND comment_type = 'trackback'";
    20342030    elseif ( 'pings' == $type )
    20352031        $typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
     2032    elseif ( !empty($type) )
     2033        $typesql = $wpdb->prepare("AND comment_type = %s", $type);
    20362034    else
    20372035        $typesql = '';
     
    21232121                printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), get_comment_link($comment->comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia')));
    21242122                echo '</div>';
    2125                 comment_text(); 
     2123                comment_text();
    21262124                if ( $user_can ) { ?>
    21272125                <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
Note: See TracChangeset for help on using the changeset viewer.