Automattic\WooCommerce\Blocks\BlockTypes
MiniCart::render
Render the Mini-Cart block.
Метод класса: MiniCart{}
Хуков нет.
Возвращает
Строку. Rendered block type output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render( $attributes, $content, $block );
- $attributes(массив) (обязательный)
- Block attributes.
- $content(строка) (обязательный)
- Block content.
- $block(WP_Block) (обязательный)
- Block instance.
Код MiniCart::render() MiniCart::render WC 10.4.3
protected function render( $attributes, $content, $block ) {
/**
* In the cart and checkout pages, the block is either rendered hidden or removed.
* It is not interactive, so it can fall back to the existing implementation.
*/
if ( Features::is_enabled( 'experimental-iapi-mini-cart' ) && ! is_cart() && ! is_checkout() ) {
return $this->render_experimental_iapi_mini_cart( $attributes, $content, $block );
}
return $content . $this->get_markup( MiniCartUtils::migrate_attributes_to_color_panel( $attributes ) );
}