Automattic\WooCommerce\Internal\OrderReviews

ItemEligibility::render_variation_summary │ public static │ WC 10.9.0

Echo the variation summary snapshot for a review comment, when present.

Wired onto woocommerce_review_before_comment_text the snapshot stored in _review_variation_summary (set by the Customer Review Request submission flow) appears immediately above the review body on the single-product Reviews tab. Comments without the meta render unchanged.

Метод класса: ItemEligibility{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = ItemEligibility::render_variation_summary( $comment ): void;
$comment(WP_Comment) (обязательный)
Review comment being rendered.

Список изменений

С версии 10.9.0 Введена.

Код ItemEligibility::render_variation_summary() WC 11.2.2

public static function render_variation_summary( \WP_Comment $comment ): void {
	$summary = (string) get_comment_meta( (int) $comment->comment_ID, self::VARIATION_SUMMARY_META_KEY, true );
	if ( '' === $summary ) {
		return;
	}

	echo '<p class="woocommerce-review__variation-summary">' . esc_html( $summary ) . '</p>';
}