Merge pull request #15332 from woocommerce/fix/15307
Hide replies from recent reviews widgets
This commit is contained in:
commit
c73461f440
|
@ -252,6 +252,7 @@ class WC_Admin_Dashboard {
|
||||||
AND comments.comment_type = ''
|
AND comments.comment_type = ''
|
||||||
AND posts.post_password = ''
|
AND posts.post_password = ''
|
||||||
AND posts.post_type = 'product'
|
AND posts.post_type = 'product'
|
||||||
|
AND comments.comment_parent = 0
|
||||||
ORDER BY comments.comment_date_gmt DESC
|
ORDER BY comments.comment_date_gmt DESC
|
||||||
LIMIT 5
|
LIMIT 5
|
||||||
" );
|
" );
|
||||||
|
|
|
@ -60,7 +60,7 @@ class WC_Widget_Recent_Reviews extends WC_Widget {
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std'];
|
$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 ) {
|
if ( $comments ) {
|
||||||
$this->widget_start( $args, $instance );
|
$this->widget_start( $args, $instance );
|
||||||
|
|
Loading…
Reference in New Issue