$lsStoreLastViewed, ]); $demoSliders = LS_Sources::getDemoSliders(); function lsPrintTemplateGridItems( $originalCategory, $items, $max = 9999, $excludeHandles = [] ) { if( empty( $items ) ) { return ''; } $counter = 0; foreach( $items as $handle => $item ) { $category = $originalCategory; if( empty( $category ) && ! empty( $item['category'] ) ) { $category = $item['category']; } // Skip when excluded if( ! empty( $excludeHandles ) ) { if( in_array( $handle, $excludeHandles ) ) { continue; } } // Skip popups in sliders if( $category === 'sliders' && ! empty( $item['popup'] ) ) { continue; } // Stop when reached the max limit if( ++$counter > $max ) { break; } $item['order'] = ! empty( $item['released'] ) ? str_replace('-', '', $item['released']) : '19700101'; $item['collections'] = ! empty( $item['collections'] ) ? $item['collections'] : ''; $item['bundled'] = ! empty( $item['bundled'] ) ? 'true' : 'false'; $item['premium'] = ! empty( $item['premium'] ) ? 'true' : 'false'; $item['requires'] = ! empty( $item['requires'] ) ? $item['requires'] : '1.0.0'; $item['warning'] = version_compare( $item['requires'], LS_PLUGIN_VERSION, '>') ? 'true' : 'false'; ?>