Add events to team pages

This commit is contained in:
Brian Miyaji
2016-04-08 15:26:59 +10:00
parent 36bc9bc622
commit 35ed9962d4
12 changed files with 227 additions and 38 deletions

View File

@@ -34,6 +34,9 @@ class SP_Calendar extends SP_Custom_Post {
/** @var int The season ID. */
public $season;
/** @var int The team ID. */
public $team;
/**
* __construct function.
*
@@ -111,6 +114,16 @@ class SP_Calendar extends SP_Custom_Post {
$season_ids = array( $this->season );
endif;
if ( $this->team ):
$args['meta_query'] = array(
array(
'key' => 'sp_team',
'value' => array( $this->team ),
'compare' => 'IN',
),
);
endif;
if ( $pagenow != 'post-new.php' ):
if ( $this->ID ):
$leagues = get_the_terms( $this->ID, 'sp_league' );