| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined('ABSPATH') ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
?><table class="wpc-form-fields-table" id="wpc-intersections-table"> |
| 8 |
<tr class="wpc-first-row"> |
| 9 |
<?php if( ! empty( $fields ) ): ?> |
| 10 |
<?php |
| 11 |
|
| 12 |
$count = count( $fields ); |
| 13 |
$rows = intdiv( $count, 3 ) + 1; |
| 14 |
$i = 1; |
| 15 |
|
| 16 |
foreach( $fields as $key => $attributes ){ ?> |
| 17 |
<td class="wpc-filter-field-td"<?php |
| 18 |
if( $count >= 5 && $i == 1 && isset( $fields['wp_entity'] ) ){ |
| 19 |
echo ' rowspan="'.$rows.'" '; |
| 20 |
} |
| 21 |
?>> |
| 22 |
<?php echo flrt_render_input( $attributes ); ?> |
| 23 |
</td> |
| 24 |
<?php |
| 25 |
// Do not try to understand this code. |
| 26 |
// Just believe it works. |
| 27 |
$sep = 4; |
| 28 |
$k = $i; |
| 29 |
if( isset( $fields['wp_entity'] ) && $count >= 5 && ($i > 4) ){ |
| 30 |
$sep = 3; |
| 31 |
$k = $i - 1; |
| 32 |
} |
| 33 |
if( ($k % $sep) === 0 ){ |
| 34 |
?> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<?php |
| 38 |
} |
| 39 |
$i++; |
| 40 |
} ?> |
| 41 |
|
| 42 |
<?php else: ?> |
| 43 |
|
| 44 |
<td class="wpc-filter-field-td"> |
| 45 |
<span class="wpc-no-seo-filters-message"><?php echo esc_html__( 'Sorry. There are no filters active for SEO for the selected post type', 'filter-everything' ); ?></span> |
| 46 |
</td> |
| 47 |
|
| 48 |
<?php endif; ?> |
| 49 |
</tr> |
| 50 |
</table> |