From dfa42e3952f35436ba94f54a155602f31aa5a4e5 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 27 Jul 2009 23:28:13 +0000 Subject: [PATCH] Allow _wp_get_comment_list to handle custom comment types, props aaroncampbell, fixes #10463 git-svn-id: https://develop.svn.wordpress.org/trunk@11748 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 40992447a7..2b0fc0a0be 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1981,13 +1981,13 @@ function user_row( $user_object, $style = '', $role = '' ) { * * @since unknown * - * @param unknown_type $status - * @param unknown_type $s - * @param unknown_type $start - * @param unknown_type $num - * @param unknown_type $post - * @param unknown_type $type - * @return unknown + * @param string $status Comment status (approved, spam, deleted, etc) + * @param string $s Term to search for + * @param int $start Offset to start at for pagination + * @param int $num Maximum number of comments to return + * @param int $post Post ID or 0 to return all comments + * @param string $type Comment type (comment, trackback, pingback, etc) + * @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num) */ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) { global $wpdb; @@ -2027,12 +2027,10 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 if ( 'comment' == $type ) $typesql = "AND comment_type = ''"; - elseif ( 'pingback' == $type ) - $typesql = "AND comment_type = 'pingback'"; - elseif ( 'trackback' == $type ) - $typesql = "AND comment_type = 'trackback'"; elseif ( 'pings' == $type ) $typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )"; + elseif ( !empty($type) ) + $typesql = $wpdb->prepare("AND comment_type = %s", $type); else $typesql = ''; @@ -2122,7 +2120,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, echo '
'; printf(__('Submitted on %2$s at %3$s'), get_comment_link($comment->comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia'))); echo '
'; - comment_text(); + comment_text(); if ( $user_can ) { ?>