post_title) ? (string) $product->post_title : __('Unknown Product', 'fluent-cart'); // The item the review names, when it does — resolved by the same helper every // other surface uses, so the email can never disagree with the admin or the // storefront about what a review is about. On a copy: the helper sets // item_label as an attribute, and this renders inside the submit request on // the very model the controller still holds — a label left on it would be // written as a column the table does not have if anything saved it. $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); } $reviewerName = trim((string) $review->reviewer_name) ?: __('Anonymous', 'fluent-cart'); $reviewerEmail = trim((string) $review->reviewer_email); $rating = max(0, min(5, (int) $review->rating)); $isVerified = !empty($review->is_verified); $photoCount = (int) $review->media_count; $isPending = $review->status === \FluentCart\App\Helpers\Status::REVIEW_PENDING; $adminUrl = admin_url('admin.php?page=fluent-cart#/reviews/' . (int) $review->id . '/view'); ?>

' . esc_html($reviewerName) . '', '' . esc_html($productTitle) . '' ); if ($isPending) { echo ' ' . esc_html__('It is waiting for your approval before it appears on the product page.', 'fluent-cart'); } else { echo ' ' . esc_html__('It is already live on the product page.', 'fluent-cart'); } ?>

0) : ?>

title)) : ?>

title); ?>

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

0) { $facts[] = esc_html(sprintf( /* translators: 1: number of photos */ _n('%1$d photo', '%1$d photos', $photoCount, 'fluent-cart'), $photoCount )); } $facts[] = $isPending ? '' . esc_html__('Pending approval', 'fluent-cart') . '' : '' . esc_html__('Approved', 'fluent-cart') . ''; echo implode('
', $facts); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each fact is escaped above ?>
→