Display config keys and event outcomes in edit list
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user