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

git-svn-id: http://svn.automattic.com/wordpress/trunk@11748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-07-27 23:28:13 +00:00
parent febbb3bbda
commit 190a148e6b

View File

@ -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 = '';