Allow retrieving comments by post type, status, author, author, name, or parent. Fetch only published posts for recent comments widget. Props filosofo. fixes #16506 #12904

git-svn-id: http://svn.automattic.com/wordpress/trunk@17667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2011-04-20 18:02:41 +00:00
parent cefee535db
commit 430bb76d4b
2 changed files with 13 additions and 1 deletions

View File

@@ -640,7 +640,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
if ( ! $number = absint( $instance['number'] ) )
$number = 5;
$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) );
$output .= $before_widget;
if ( $title )
$output .= $before_title . $title . $after_title;