Automattic\WooCommerce\Blocks\BlockTypes
MiniCartContents::render
Render the markup for the Mini-Cart Contents block.
Method of the class: MiniCartContents{}
No Hooks.
Returns
String. Rendered block type 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.
MiniCartContents::render() MiniCartContents::render code WC 10.6.2
protected function render( $attributes, $content, $block ) {
if ( is_admin() || WC()->is_rest_api_request() ) {
// In the editor we will display the placeholder, so no need to
// print the markup.
return '';
}
if ( Features::is_enabled( 'experimental-iapi-mini-cart' ) ) {
return $this->render_experimental_iapi_mini_cart_contents( $attributes, $content, $block );
}
return $content;
}