wc_get_loop_class; force columns to be a minimum of 1

This commit is contained in:
Mike Jolley 2018-02-22 15:44:28 +00:00
parent 8d6c51bfb0
commit 3353d80ecd
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ add_action( 'after_switch_theme', 'wc_reset_product_grid_settings' );
*/
function wc_get_loop_class() {
$loop_index = wc_get_loop_prop( 'loop', 0 );
$columns = wc_get_loop_prop( 'columns', wc_get_default_products_per_row() );
$columns = absint( max( 1, wc_get_loop_prop( 'columns', wc_get_default_products_per_row() ) ) );
$loop_index ++;
wc_set_loop_prop( 'loop', $loop_index );