Add league table widget team limit

This commit is contained in:
Brian Miyaji
2014-03-07 12:13:00 +11:00
parent cbf2a51f7f
commit 45e45c2211
2 changed files with 12 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
$options = get_option( 'sportspress' );
$defaults = array(
'number' => -1,
'columns' => null,
'show_full_table_link' => false,
'show_team_logo' => sportspress_array_value( $options, 'league_table_show_team_logo', false ),
@@ -39,6 +40,9 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
$i = 0;
if ( is_int( $r['number'] ) && $r['number'] > 0 )
$data = array_slice( $data, 0, $r['number'] );
foreach( $data as $team_id => $row ):
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';