Add events to team pages
This commit is contained in:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user