Add calendar variable at countdown shortcode
This commit is contained in:
@@ -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 ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user