Automattic\WooCommerce\Blocks\BlockTypes\Reviews
ProductReviews::render
Render the block.
Метод класса: ProductReviews{}
Хуков нет.
Возвращает
string. Rendered block output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render( $attributes, $content, $block );
- $attributes(массив) (обязательный)
- Block attributes.
- $content(строка) (обязательный)
- Block content.
- $block(WP_Block) (обязательный)
- Block instance.
Код ProductReviews::render() ProductReviews::render WC 11.2.1
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();
}