PluginProbe ʕ •ᴥ•ʔ
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More / 2.10.0
Reviews Feed – Add Testimonials and Customer Reviews From Google Reviews, Yelp, TripAdvisor, and More v2.10.0
2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.7 2.6.8 2.6.5 2.6.4 2.6.3 2.6.2 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1 1.1.1 1.1.2 1.2.0 2.0 2.1.0 2.1.1 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1
reviews-feed / templates / frontend / post-elements / extras / booking.php
reviews-feed / templates / frontend / post-elements / extras Last commit date
airbnb.php 4 weeks ago aliexpress.php 4 weeks ago booking.php 4 weeks ago
booking.php
41 lines
1 <?php
2
3 /**
4 * Booking.com extras — additive per-provider markup (SMASH-782 Phase 2).
5 *
6 * Renders the per-card AFTER `render_post_elements()`:
7 * sb-item-helpful
8 * <svg HelpfulIcon /> "N people found this helpful"
9 *
10 * The score badge (`.sb-item-rating-score`) is rendered INSIDE
11 * `.sb-item-rating` via `rating-extras/booking.php` so it sits in the same
12 * visual slot as star ratings (right after the author block) — matches the
13 * prototype's BookingCard.jsx layout.
14 *
15 * Real data only:
16 * - Helpful row: renders ONLY when metadata.helpful_vote_count > 0
17 *
18 * @since SMASH-782 Phase 2
19 */
20
21 if (!defined('ABSPATH')) {
22 exit;
23 }
24
25 $helpful = isset($post['metadata']['helpful_vote_count']) ? intval($post['metadata']['helpful_vote_count']) : 0;
26 if ($helpful <= 0) {
27 return;
28 }
29 $helpful_icon_svg = '<svg class="sb-item-helpful-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M14 5.33h-3.63l.75-3.07a1.14 1.14 0 0 0-2-.91L5.5 5a1.16 1.16 0 0 0-.17.55v6.78c0 .37.13.71.39.97.26.26.6.4.97.4H12c.26 0 .5-.08.73-.23.23-.16.4-.35.5-.57l2-4.7c.04-.08.06-.16.07-.25a3 3 0 0 0 .03-.25V6.67c0-.36-.13-.68-.4-.94a1.3 1.3 0 0 0-.93-.4ZM2.67 14c-.37 0-.7-.13-.97-.4a1.3 1.3 0 0 1-.4-.93v-6c0-.36.13-.69.4-.95.26-.26.6-.39.97-.39s.69.13.95.39c.26.26.39.59.39.95v6c0 .36-.13.68-.4.94-.26.26-.58.39-.94.39Z" fill="#696D80"/></svg>';
30 ?>
31 <div class="sb-item-helpful sbr-review-horizontal-element">
32 <?php echo $helpful_icon_svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static SVG, no user input ?>
33 <span class="sb-item-helpful-count">
34 <?php echo esc_html(sprintf(
35 /* translators: %d = helpful vote count */
36 _n('%d person found this helpful', '%d people found this helpful', $helpful, 'reviews-feed'),
37 $helpful
38 )); ?>
39 </span>
40 </div>
41