admin/classes/admin-options/fields/reviews-selector
class-merchant-field-reviews-selector.php
1.4 KB
1 month ago
template.php
1.8 KB
1 month ago
template.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 2.3.1, at admin/classes/admin-options/fields/reviews-selector/template.php
| 1 | <?php |
| 2 | /** |
| 3 | * Template: Reviews Selector field. |
| 4 | * |
| 5 | * @var array<string, mixed> $settings Field configuration. |
| 6 | * @var mixed $value Current saved value. |
| 7 | * @var string $module_id Module ID. |
| 8 | * |
| 9 | * @package Merchant |
| 10 | * @since 2.2.5 |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | |
| 17 | if ( ! is_array( $value ) ) { |
| 18 | $value = array(); |
| 19 | } |
| 20 | ?> |
| 21 | <div class="merchant-reviews-selector" data-id="<?php echo esc_attr( $settings['id'] ); ?>"> |
| 22 | <div class="selected-reviews"> |
| 23 | <div class="product-reviews"><?php // keep this (no space) between the div and php tag to avoid white space issues with css |
| 24 | foreach ( $value as $review ) { |
| 25 | echo wp_kses( Merchant_Admin_Ajax::get_review( $review ), merchant_kses_allowed_tags( array( 'div' ) ) ); |
| 26 | } ?></div> |
| 27 | </div> |
| 28 | <button type="button" class="merchant-btn-control popup-trigger"><?php esc_html_e( 'Select Reviews', 'merchant' ); ?></button> |
| 29 | <div class="overlay"></div> |
| 30 | <div class="selector-popup"> |
| 31 | <div class="popup-content"> |
| 32 | <div class="popup-header"> |
| 33 | <label> |
| 34 | <span> |
| 35 | <?php esc_html_e( 'Search & filter', 'merchant' ); ?> |
| 36 | </span> |
| 37 | <input type="text" name="products_search" class="products-search" placeholder="<?php echo esc_attr__( 'Search for a product', 'merchant' ); ?>"> |
| 38 | </label> |
| 39 | |
| 40 | <span class="close" title="<?php esc_attr_e( 'Close', 'merchant' ); ?>">×</span> |
| 41 | </div> |
| 42 | <div class="popup-body merchant-reviews-selector-body"> |
| 43 | <div class="products-search-results"> |
| 44 | <?php |
| 45 | echo wp_kses( Merchant_Admin_Ajax::products_selector_search_results(), merchant_kses_allowed_tags( array( 'div' ) ) ); ?> |
| 46 | </div> |
| 47 | </div> |
| 48 | <div class="loader"></div> |
| 49 | </div> |
| 50 | </div> |
| 51 | <input type="hidden" class="review-saved-ids" name="merchant[<?php echo esc_attr( $settings['id'] ); ?>]" value="<?php |
| 52 | echo esc_attr( implode( ',', $value ) ) ?>"> |
| 53 | </div> |
| 54 | <?php |
| 55 |