Automattic\WooCommerce\Blocks\BlockTypes\Reviews

ProductReviews::renderprotectedWC 1.0

Render the block.

Method of the class: ProductReviews{}

No Hooks.

Returns

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 10.3.5

protected function render( $attributes, $content, $block ) {
	if ( empty( $block->parsed_block['innerBlocks'] ) ) {
		return $this->render_legacy_block( $attributes, $content, $block );
	}

	if ( ! comments_open() ) {
		return '';
	}

	$p = new \WP_HTML_Tag_Processor( $content );
	$p->next_tag();
	$p->set_attribute( 'data-wp-interactive', $this->get_full_block_name() );
	$p->set_attribute( 'data-wp-router-region', $this->get_full_block_name() );

	return $p->get_updated_html();
}