Add icons module

This commit is contained in:
Brian Miyaji
2015-09-17 12:33:16 +10:00
parent 98990c0995
commit d0e77dcb4d
16 changed files with 404 additions and 123 deletions

View File

@@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
// Initialize totals
$totals = array();
?>
<div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?>">
<div class="sp-template sp-template-event-performance sp-template-event-performance-combined sp-template-event-performance-<?php echo $mode; ?>">
<?php if ( $caption ): ?>
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
<?php endif; ?>
@@ -94,9 +94,11 @@ $totals = array();
echo '<td class="data-' . $key . '">' . $value . '</td>';
elseif ( intval( $value ) && $mode == 'icons' ):
$performance_id = sp_array_value( $performance_ids, $key, null );
$icons = '';
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
endif;
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
endif;
endforeach;
@@ -142,9 +144,11 @@ $totals = array();
echo '<td class="data-' . $key . '">' . $value . '</td>';
elseif ( intval( $value ) && $mode == 'icons' ):
$performance_id = sp_array_value( $performance_ids, $key, null );
$icons = '';
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
$icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
endif;
echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
endif;
endforeach;