WordPress at Your Fingertips
function is not described

WC_Admin_Addons::output_group() private WC 1.0

Render a group block including products

{} It's a method of the class: WC_Admin_Addons{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Admin_Addons::output_group( $block );
$block(mixed) (required)
Block of the page for rendering.

Code of WC_Admin_Addons::output_group() WC 5.9.0

<?php
private static function output_group( $block ) {
	$capacity             = $block->capacity ?? 3;
	$product_list_classes = 3 === $capacity ? 'three-column' : 'two-column';
	$product_list_classes = 'products addons-products-' . $product_list_classes;
	?>
		<section class="addon-product-group">
			<h1 class="addon-product-group-title"><?php echo esc_html( $block->title ); ?></h1>
			<div class="addon-product-group-description-container">
				<?php if ( ! empty( $block->description ) ) : ?>
				<div class="addon-product-group-description">
					<?php echo esc_html( $block->description ); ?>
				</div>
				<?php endif; ?>
				<?php if ( null !== $block->url ) : ?>
				<a class="addon-product-group-see-more" href="<?php echo esc_url( $block->url ); ?>">
					<?php esc_html_e( 'See more', 'woocommerce' ); ?>
				</a>
				<?php endif; ?>
			</div>
			<div class="addon-product-group__items">
				<ul class="<?php echo esc_attr( $product_list_classes ); ?>">
				<?php
				$products = array_slice( $block->items, 0, $capacity );
				foreach ( $products as $item ) {
					self::render_product_card( $item );
				}
				?>
				</ul>
			<div>
		</section>
	<?php
}