Add date and time option for showing on the countdown widget
This commit is contained in:
@@ -15,6 +15,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
$id = empty($instance['id']) ? null : $instance['id'];
|
||||
$show_venue = empty($instance['show_venue']) ? false : $instance['show_venue'];
|
||||
$show_league = empty($instance['show_league']) ? false : $instance['show_league'];
|
||||
$show_date = empty($instance['show_date']) ? false : $instance['show_date'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
|
||||
echo $before_widget;
|
||||
@@ -25,7 +26,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );
|
||||
|
||||
sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league ) );
|
||||
sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date ) );
|
||||
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' );
|
||||
@@ -43,6 +44,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
$instance['id'] = intval($new_instance['id']);
|
||||
$instance['show_venue'] = intval($new_instance['show_venue']);
|
||||
$instance['show_league'] = intval($new_instance['show_league']);
|
||||
$instance['show_date'] = intval($new_instance['show_date']);
|
||||
|
||||
// Filter to hook into
|
||||
$instance = apply_filters( 'sportspress_widget_update', $instance, $new_instance, $old_instance, 'countdown' );
|
||||
@@ -59,6 +61,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
$id = intval($instance['id']);
|
||||
$show_venue = intval($instance['show_venue']);
|
||||
$show_league = intval($instance['show_league']);
|
||||
$show_date = intval($instance['show_date']);
|
||||
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' );
|
||||
@@ -129,6 +132,9 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_league'); ?>" name="<?php echo $this->get_field_name('show_league'); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id('show_league'); ?>"><?php _e( 'Display league', 'sportspress' ); ?></label></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_date'); ?>" name="<?php echo $this->get_field_name('show_date'); ?>" value="1" <?php checked( $show_date, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Display date', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template_form', $this, $instance, 'countdown' );
|
||||
|
||||
Reference in New Issue
Block a user