Merge pull request #15332 from woocommerce/fix/15307

Hide replies from recent reviews widgets
This commit is contained in:
Claudio Sanches 2017-05-29 12:00:57 -03:00 committed by GitHub
commit c73461f440
2 changed files with 2 additions and 1 deletions

View File

@ -252,6 +252,7 @@ class WC_Admin_Dashboard {
AND comments.comment_type = ''
AND posts.post_password = ''
AND posts.post_type = 'product'
AND comments.comment_parent = 0
ORDER BY comments.comment_date_gmt DESC
LIMIT 5
" );

View File

@ -60,7 +60,7 @@ class WC_Widget_Recent_Reviews extends WC_Widget {
ob_start();
$number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std'];
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product' ) );
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product', 'parent' => 0 ) );
if ( $comments ) {
$this->widget_start( $args, $instance );