Display total statistics per player
This commit is contained in:
@@ -83,6 +83,9 @@ class SP_Player extends SP_Custom_Post {
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
$div_ids[] = 0;
|
||||
$season_names[0] = __( 'Total', 'sportspress' );
|
||||
|
||||
$data = array();
|
||||
|
||||
// Get all seasons populated with data where available
|
||||
@@ -138,18 +141,25 @@ class SP_Player extends SP_Custom_Post {
|
||||
),
|
||||
'tax_query' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'field' => 'id',
|
||||
'terms' => $league_id
|
||||
),
|
||||
array(
|
||||
'taxonomy' => 'sp_season',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
if ( $league_id ):
|
||||
$args['tax_query'][] = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'field' => 'id',
|
||||
'terms' => $league_id
|
||||
);
|
||||
endif;
|
||||
|
||||
if ( $div_id ):
|
||||
$args['tax_query'][] = array(
|
||||
'taxonomy' => 'sp_season',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
);
|
||||
endif;
|
||||
|
||||
$events = get_posts( $args );
|
||||
|
||||
// Event loop
|
||||
|
||||
Reference in New Issue
Block a user