Display config keys and event outcomes in edit list

This commit is contained in:
Brian Miyaji
2014-01-03 02:07:08 +11:00
parent f0b0bae8bc
commit c04aad9a75
8 changed files with 35 additions and 26 deletions

View File

@@ -24,7 +24,8 @@ function sp_column_edit_columns() {
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_equation' => __( 'Equation', 'sportspress' ),
'sp_order' => __( 'Sort Order', 'sportspress' )
'sp_order' => __( 'Sort Order', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' )
);
return $columns;
}

View File

@@ -23,7 +23,8 @@ function sp_outcome_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' )
);
return $columns;
}

View File

@@ -21,7 +21,8 @@ add_action( 'init', 'sp_result_cpt_init' );
function sp_result_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' )
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' )
);
return $columns;
}

View File

@@ -24,6 +24,7 @@ function sp_statistic_edit_columns() {
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_equation' => __( 'Equation', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' )
);
return $columns;
}

View File

@@ -106,13 +106,13 @@ function sp_team_columns_meta( $post ) {
$events = get_posts( $args );
foreach( $events as $event ):
$totals['eventsplayed']++;
$results = (array)get_post_meta( $event->ID, 'sp_results', true );
foreach ( $results as $team_id => $team_result ):
foreach ( $team_result as $key => $value ):
if ( $team_id == $post->ID ):
if ( $key == 'outcome' ):
if ( array_key_exists( $value, $totals ) ):
$totals['eventsplayed']++;
$totals[ $value ]++;
endif;
else: