Add calendar variable at countdown shortcode

This commit is contained in:
savvasha
2018-01-22 17:44:25 +02:00
parent 195e6d6000
commit 7ebb97bfd9

View File

@@ -11,6 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$defaults = array( $defaults = array(
'team' => null, 'team' => null,
'calendar' => null,
'league' => null, 'league' => null,
'season' => null, 'season' => null,
'id' => null, 'id' => null,
@@ -21,9 +22,17 @@ $defaults = array(
'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false,
'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false, 'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false,
); );
if ( isset( $id ) ): if ( isset( $id ) ):
$post = get_post( $id ); $post = get_post( $id );
elseif ( $calendar ):
$calendar = new SP_Calendar( $calendar );
if ( $team )
$calendar->team = $team;
$calendar->status = 'future';
$calendar->number = 1;
$calendar->order = 'ASC';
$data = $calendar->data();
$post = array_shift( $data );
else: else:
$args = array(); $args = array();
if ( isset( $team ) ) { if ( isset( $team ) ) {