Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::render_callback()publicWC 1.0

The default render_callback for all blocks. This will ensure assets are enqueued just in time, then render the block (if applicable).

{} Это метод класса: AbstractBlock{}

Хуков нет.

Возвращает

Строку. Rendered block type output.

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

$AbstractBlock = new AbstractBlock();
$AbstractBlock->render_callback( $attributes, $content );
$attributes(массив|WP_Block)
Block attributes, or an instance of a WP_Block.
По умолчанию: an empty array
$content(строка)
Block content.
По умолчанию: empty string

Код AbstractBlock::render_callback() WC 6.9.4

public function render_callback( $attributes = [], $content = '' ) {
	$render_callback_attributes = $this->parse_render_callback_attributes( $attributes );
	if ( ! is_admin() && ! WC()->is_rest_api_request() ) {
		$this->enqueue_assets( $render_callback_attributes );
	}
	return $this->render( $render_callback_attributes, $content );
}