Merge pull request #19088 from woocommerce/fix/19085

wc_get_loop_class; force columns to be a minimum of 1
This commit is contained in:
Claudio Sanches 2018-02-22 12:53:17 -03:00 committed by GitHub
commit f2d90deec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 );