Add argument to countdown widget function

This commit is contained in:
Brian Miyaji
2014-02-22 12:27:00 +11:00
parent 9f46acc6b5
commit 2e07363c3d
2 changed files with 6 additions and 14 deletions

View File

@@ -8,18 +8,10 @@ if ( !function_exists( 'sportspress_countdown' ) ) {
if ( $id ):
$post = get_post( $id );
else:
$options = array(
'post_type' => 'sp_event',
'posts_per_page' => 1,
'order' => 'ASC',
'post_status' => 'future',
'meta_query' => array(),
);
$args = array();
if ( isset( $args['team'] ) )
$options['meta_query'][] = array( 'key' => 'sp_team', 'value' => $args['team'] );
$posts = get_posts( $options );
$post = array_pop( $posts );
$args = array( 'key' => 'sp_team', 'value' => $args['team'] );
$post = sportspress_get_next_event( $args );
endif;
$output = '';