Give teams option to show and hide seasons

This commit is contained in:
Brian Miyaji
2014-01-15 14:55:30 +11:00
parent d198a2cea1
commit e3a04bc8c9
5 changed files with 56 additions and 45 deletions

View File

@@ -7,8 +7,8 @@ function sportspress_save_post( $post_id ) {
switch ( $_POST['post_type'] ):
case ( 'sp_team' ):
// Update columns
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
// Update leagues seasons to show
update_post_meta( $post_id, 'sp_leagues_seasons', sportspress_array_value( $_POST, 'sp_leagues_seasons', array() ) );
break;
@@ -87,9 +87,6 @@ function sportspress_save_post( $post_id ) {
case ( 'sp_player' ):
// Update player statistics
update_post_meta( $post_id, 'sp_statistics', sportspress_array_value( $_POST, 'sp_statistics', array() ) );
// Update team array
sportspress_update_post_meta_recursive( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) );

View File

@@ -52,6 +52,8 @@ function sportspress_team_columns_meta( $post ) {
// Loop through statistics for each league
foreach ( $leagues as $league ):
$league_id = $league->term_id;
if ( $league_num > 1 ):
?>
@@ -59,9 +61,9 @@ function sportspress_team_columns_meta( $post ) {
<?php
endif;
list( $columns, $data, $placeholders, $merged ) = sportspress_get_team_columns_data( $post->ID, $league->term_id, true );
list( $columns, $data, $data, $leagues_seasons ) = sportspress_get_team_columns_data( $post->ID, $league_id, true );
sportspress_edit_team_columns_table( $columns, $data, $placeholders );
sportspress_edit_team_columns_table( $league_id, $columns, $data, $leagues_seasons );
endforeach;