Enable selecting date from widgets

This commit is contained in:
Brian Miyaji
2014-06-18 23:17:34 +10:00
parent 51b115377e
commit 96786dc365
5 changed files with 46 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
* @version 0.8
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -13,6 +13,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
$defaults = array(
'status' => 'default',
'date' => 'default',
'number' => -1,
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
@@ -26,6 +27,8 @@ extract( $defaults, EXTR_SKIP );
$calendar = new SP_Calendar( $id );
if ( $status != 'default' )
$calendar->status = $status;
if ( $date != 'default' )
$calendar->date = $date;
if ( $order != 'default' )
$calendar->order = $order;
$data = $calendar->data();

View File

@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
* @version 0.8
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -91,7 +91,7 @@ $next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS yea
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
$calendar_caption = _x('%1$s %2$s', 'calendar caption', 'sportspress');
$calendar_output = '
<div class="widget_calendar sp-calendar-wrapper">
<div class="sp-calendar-wrapper">
<table id="wp-calendar" class="sp-calendar sp-event-calendar">
<caption class="sp-table-caption">' . ( $caption_tag == 'caption' ? '' : '<' . $caption_tag . '>' ) . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . ( $caption_tag == 'caption' ? '' : '</' . $caption_tag . '>' ) . '</caption>
<thead>

View File

@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
* @version 0.8
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -13,6 +13,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
$defaults = array(
'status' => 'default',
'date' => 'default',
'number' => -1,
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
'link_venues' => get_option( 'sportspress_calendar_link_venues', 'yes' ) == 'yes' ? true : false,
@@ -29,6 +30,8 @@ extract( $defaults, EXTR_SKIP );
$calendar = new SP_Calendar( $id );
if ( $status != 'default' )
$calendar->status = $status;
if ( $date != 'default' )
$calendar->date = $date;
if ( $order != 'default' )
$calendar->order = $order;
$data = $calendar->data();