post_title) ? (string) $product->post_title : __('the product', 'fluent-cart'); // The item the review names, when it does — on a copy, for the reason the // approval template gives: the helper sets item_label as an attribute, and // this can render on a model the caller goes on to save(). $reviewWithItemLabel = clone $review; \FluentCart\App\Services\ProductReviewService::attachItemLabels([$reviewWithItemLabel]); $itemLabel = trim((string) $reviewWithItemLabel->getAttribute('item_label')); if ($itemLabel !== '') { /* translators: 1: product title, 2: item (variation) label */ $productTitle = sprintf(__('%1$s (%2$s)', 'fluent-cart'), $productTitle, $itemLabel); } $productId = $product && !empty($product->ID) ? (int) $product->ID : (int) $review->post_id; $productUrl = $productId ? get_permalink($productId) : ''; $storeName = trim((string) (new \FluentCart\Api\StoreSettings())->get('store_name')); if ($storeName === '') { $storeName = (string) get_bloginfo('name'); } $reviewerName = trim((string) $review->reviewer_name); $rating = max(0, min(5, (int) $review->rating)); ?>

' . esc_html($storeName) . '', '' . esc_html($productTitle) . '' ); ?>

0) : ?>

title)) : ?>

title); ?>

content)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped by esc_html() before nl2br() ?>

content)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped by esc_html() before nl2br() ?>

→