Automattic\WooCommerce\Blocks\BlockTypes

ProductReviews::render()protectedWC 1.0

Render the block.

Method of the class: ProductReviews{}

No Hooks.

Return

String. Rendered block output.

Usage

// protected - for code of main (parent) or child class
$result = $this->render( $attributes, $content, $block );
$attributes(array) (required)
Block attributes.
$content(string) (required)
Block content.
$block(WP_Block) (required)
Block instance.

ProductReviews::render() code WC 9.5.1

protected function render( $attributes, $content, $block ) {
	ob_start();

	rewind_posts();
	while ( have_posts() ) {
		the_post();
		comments_template();
	}

	$reviews = ob_get_clean();

	return sprintf(
		'<div class="wp-block-woocommerce-product-reviews %1$s">
			%2$s
		</div>',
		StyleAttributesUtils::get_classes_by_attributes( $attributes, array( 'extra_classes' ) ),
		$reviews
	);
}