Add settings page and use EOS to calculate team and player stats

This commit is contained in:
Takumi
2013-08-22 00:50:16 +10:00
parent de4d404303
commit 4a6f27a495
7 changed files with 898 additions and 348 deletions

View File

@@ -73,7 +73,14 @@ function sp_team_stats_meta( $post ) {
$placeholders[ $league_id ] = sp_get_stats_row( 'sp_team', $args );
endforeach;
sp_stats_table( $data, $placeholders, 0, array( 'League', 'P', 'W', 'D', 'L', 'F', 'A', 'GD', 'Pts' ), false, 'sp_league' );
// Get column names from settings
$stats_settings = get_option( 'sportspress_stats' );
$columns = sp_get_eos_keys( $stats_settings['team'] );
// Add first column label
array_unshift( $columns, __( 'League', 'sportspress' ) );
sp_stats_table( $data, $placeholders, 0, $columns, false, 'sp_league' );
sp_nonce();
}
?>