Fixed missing reviews for product_page shortcode with SKU

When quering with SKU, WP_Query does not set `is_single` as true and this
makes fail the check inside `comments_template()`.

Closes #16128
This commit is contained in:
Claudio Sanches 2017-07-14 14:06:18 -03:00
parent 2e663af024
commit e5ebfb6141
1 changed files with 3 additions and 0 deletions

View File

@ -731,6 +731,9 @@ class WC_Shortcodes {
<?php <?php
} }
// For "is_single" to always make load comments_template() for reviews.
$single_product->is_single = true;
ob_start(); ob_start();
global $wp_query; global $wp_query;