Merge pull request #125 from MounirHamani/MounirHamani-patch-Filter-teams-by-competition-and-season-when-creating-an-event

Filter teams by competition and season when creating an event.
This commit is contained in:
ThemeBoy
2015-03-27 17:51:50 +11:00

View File

@@ -55,6 +55,10 @@ class SP_Meta_Box_Event_Teams {
</p>
<p class="sp-tab-select sp-title-generator">
<?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(
'post_type' => 'sp_team',
'name' => 'sp_team[]',
@@ -63,6 +67,8 @@ class SP_Meta_Box_Event_Teams {
'values' => 'ID',
'selected' => $team,
'chosen' => true,
'sp_league' => $league_slug,
'sp-season' => $season_slug,
);
sp_dropdown_pages( $args );
?>
@@ -97,4 +103,4 @@ class SP_Meta_Box_Event_Teams {
}
}
}
}
}