Add League table on Meta box Calendar

This commit is contained in:
Walker Franson
2015-03-27 16:37:44 -03:00
parent fceb52d6ba
commit 57bd1f4558
2 changed files with 31 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ class SP_Calendar extends SP_Custom_Post {
$seasons = get_the_terms( $this->ID, 'sp_season' );
$venues = get_the_terms( $this->ID, 'sp_venue' );
$team = get_post_meta( $this->ID, 'sp_team', true );
$table = get_post_meta( $this->ID, 'sp_table', true );
if ( $leagues ):
$league_ids = array();
@@ -150,6 +151,19 @@ class SP_Calendar extends SP_Custom_Post {
);
endif;
if ( $table ) :
$teams = get_post_meta( $table, 'sp_team' );
$teams = array_filter( $teams );
$args['meta_query'] = array(
array(
'key' => 'sp_team',
'value' => $teams,
'compare' => 'IN'
),
);
endif;
endif;
$events = get_posts( $args );