Optimize competition & season filter for teams in event
This commit is contained in:
@@ -55,10 +55,6 @@ class SP_Meta_Box_Event_Teams {
|
|||||||
</p>
|
</p>
|
||||||
<p class="sp-tab-select sp-title-generator">
|
<p class="sp-tab-select sp-title-generator">
|
||||||
<?php
|
<?php
|
||||||
$league = get_term( $league_id, 'sp_league' );
|
|
||||||
$league_slug = $league->slug;
|
|
||||||
$season = get_term( $season_id, 'sp_season' );
|
|
||||||
$season_slug = $season->slug;
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => 'sp_team',
|
'post_type' => 'sp_team',
|
||||||
'name' => 'sp_team[]',
|
'name' => 'sp_team[]',
|
||||||
@@ -67,9 +63,20 @@ class SP_Meta_Box_Event_Teams {
|
|||||||
'values' => 'ID',
|
'values' => 'ID',
|
||||||
'selected' => $team,
|
'selected' => $team,
|
||||||
'chosen' => true,
|
'chosen' => true,
|
||||||
'sp_league' => $league_slug,
|
'tax_query' => array(),
|
||||||
'sp-season' => $season_slug,
|
|
||||||
);
|
);
|
||||||
|
if ( $league_id ) {
|
||||||
|
$args['tax_query'][] = array(
|
||||||
|
'taxonomy' => 'sp_league',
|
||||||
|
'terms' => $league_id,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ( $season_id ) {
|
||||||
|
$args['tax_query'][] = array(
|
||||||
|
'taxonomy' => 'sp_season',
|
||||||
|
'terms' => $season_id,
|
||||||
|
);
|
||||||
|
}
|
||||||
sp_dropdown_pages( $args );
|
sp_dropdown_pages( $args );
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user