default.php
40 lines
| 1 | <?php defined('ABSPATH') || exit; |
| 2 | |
| 3 | \ShopEngine\Widgets\Widget_Helper::instance()->comment_template_filter_checker(); |
| 4 | |
| 5 | ?> |
| 6 | |
| 7 | <div class="shopengine-product-review"> |
| 8 | <?php |
| 9 | |
| 10 | $open = comments_open(); |
| 11 | |
| 12 | $in_editor_mode = \ShopEngine\Core\Template_Cpt::TYPE == get_post_type(); |
| 13 | |
| 14 | if($in_editor_mode) { |
| 15 | |
| 16 | $open = true; |
| 17 | |
| 18 | global $post; |
| 19 | |
| 20 | $main_post = clone $post; |
| 21 | |
| 22 | $post = get_post($product->get_id()); |
| 23 | |
| 24 | include __DIR__ . '/dummy-review.php'; |
| 25 | } |
| 26 | |
| 27 | if($open && !$in_editor_mode) { |
| 28 | comments_template(); |
| 29 | } |
| 30 | |
| 31 | if($in_editor_mode) { |
| 32 | |
| 33 | global $post; |
| 34 | |
| 35 | $post = $main_post; |
| 36 | } |
| 37 | |
| 38 | ?> |
| 39 | </div> |
| 40 |