WordPress at a glance
function is not described

wc_get_loop_class() WC 2.6.0

Get classname for woocommerce loops.

No Hooks.

Return

String. Nothing.

Usage

wc_get_loop_class();

Changelog

Since 2.6.0 Introduced.

Code of wc_get_loop_class() WC 5.2.2

<?php
function wc_get_loop_class() {
	$loop_index = wc_get_loop_prop( 'loop', 0 );
	$columns    = absint( max( 1, wc_get_loop_prop( 'columns', wc_get_default_products_per_row() ) ) );

	$loop_index ++;
	wc_set_loop_prop( 'loop', $loop_index );

	if ( 0 === ( $loop_index - 1 ) % $columns || 1 === $columns ) {
		return 'first';
	}

	if ( 0 === $loop_index % $columns ) {
		return 'last';
	}

	return '';
}