Add Countdown Timer widget
This commit is contained in:
@@ -13,8 +13,9 @@ if ( !function_exists( 'sportspress_events' ) ) {
|
|||||||
$options['posts_per_page'] = $args['number'];
|
$options['posts_per_page'] = $args['number'];
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ( isset( $args['status'] ) && $args['status'] == 'any' || $args['status'] == 'scheduled' ):
|
if ( isset( $args['status'] ) && $args['status'] == 'future' ):
|
||||||
$options['post_status'] = array( 'publish', 'future' );
|
$options['post_status'] = array( 'future' );
|
||||||
|
$options['order'] = 'ASC';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ( isset( $args['league'] ) ):
|
if ( isset( $args['league'] ) ):
|
||||||
|
|||||||
91
admin/widgets/countdown-timer.php
Normal file
91
admin/widgets/countdown-timer.php
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
class SP_Widget_Countdown_Timer extends WP_Widget {
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
$widget_ops = array('classname' => 'widget_countdown_timer widget_sp_countdown_timer', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
||||||
|
parent::__construct('sp_countdown_timer', __( 'Countdown Timer', 'sportspress' ), $widget_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
function widget( $args, $instance ) {
|
||||||
|
extract($args);
|
||||||
|
$title = apply_filters('widget_title', empty($instance['title']) ? __( 'Countdown Timer', 'sportspress' ) : $instance['title'], $instance, $this->id_base);
|
||||||
|
echo $before_widget;
|
||||||
|
$id = empty($instance['id']) ? null : $instance['id'];
|
||||||
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
|
if ( $id )
|
||||||
|
$post = get_post( $id );
|
||||||
|
if ( isset( $post ) ):
|
||||||
|
echo '<div id="sp_countdown_timer_wrap">';
|
||||||
|
echo '<h3 class="event-name"><a href="' . get_permalink( $post->ID ) . '">' . $post->post_title . '</a></h3>';
|
||||||
|
|
||||||
|
$leagues = get_the_terms( $post->ID, 'sp_league' );
|
||||||
|
if ( $leagues ):
|
||||||
|
foreach( $leagues as $league ):
|
||||||
|
$term = get_term( $league->term_id, 'sp_league' );
|
||||||
|
echo '<h5 class="event-league">' . $term->name . '</h5>';
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$venues = get_the_terms( $post->ID, 'sp_venue' );
|
||||||
|
if ( $venues ):
|
||||||
|
foreach( $venues as $venue ):
|
||||||
|
$term = get_term( $venue->term_id, 'sp_venue' );
|
||||||
|
echo '<h5 class="event-venue"><div class="dashicons dashicons-location"></div> ' . $term->name . '</h5>';
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$now = new DateTime( date("Y-m-d H:i:s") );
|
||||||
|
$date = new DateTime( $post->post_date );
|
||||||
|
$interval = $date->diff( $now );
|
||||||
|
|
||||||
|
echo '<h3 class="countdown-timer sp-countdown-timer clearfix"><time datetime="' . $post->post_date . '">' .
|
||||||
|
'<span class="d">' . $interval->d . ' <small>' . __( 'Days', 'sportspress' ) . '</small></span> ' .
|
||||||
|
'<span class="h">' . $interval->h . ' <small>' . __( 'Hours', 'sportspress' ) . '</small></span> ' .
|
||||||
|
'<span class="m">' . $interval->m . ' <small>' . __( 'Mins', 'sportspress' ) . '</small></span> ' .
|
||||||
|
'<span class="s">' . $interval->s . ' <small>' . __( 'Secs', 'sportspress' ) . '</small></span>' .
|
||||||
|
'</time></h3>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
endif;
|
||||||
|
echo $after_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update( $new_instance, $old_instance ) {
|
||||||
|
$instance = $old_instance;
|
||||||
|
$instance['title'] = strip_tags($new_instance['title']);
|
||||||
|
$instance['id'] = intval($new_instance['id']);
|
||||||
|
|
||||||
|
return $instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
function form( $instance ) {
|
||||||
|
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '' ) );
|
||||||
|
$title = strip_tags($instance['title']);
|
||||||
|
$id = intval($instance['id']);
|
||||||
|
?>
|
||||||
|
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('id'); ?>"><?php _e( 'Event:', 'sportspress' ); ?></label>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_event',
|
||||||
|
'name' => $this->get_field_name('id'),
|
||||||
|
'id' => $this->get_field_id('id'),
|
||||||
|
'selected' => $id,
|
||||||
|
'show_option_none' => '(' . __( 'Next Event', 'premier' ) . ')',
|
||||||
|
'values' => 'ID',
|
||||||
|
'class' => 'widefat',
|
||||||
|
'show_dates' => true,
|
||||||
|
'post_status' => 'future',
|
||||||
|
);
|
||||||
|
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||||
|
sportspress_post_adder( 'sp_event' );
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'widgets_init', create_function( '', 'return register_widget( "SP_Widget_Countdown_Timer" );' ) );
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
class SportsPress_Widget_Calendar extends WP_Widget {
|
class SportsPress_Widget_Events_Calendar extends WP_Widget {
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$widget_ops = array('classname' => 'widget_calendar widget_sp_calendar', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
$widget_ops = array('classname' => 'widget_calendar widget_sp_events_calendar', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
||||||
parent::__construct('sp_calendar', __( 'Events Calendar', 'sportspress' ), $widget_ops);
|
parent::__construct('sp_events_calendar', __( 'Events Calendar', 'sportspress' ), $widget_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
@@ -34,4 +34,4 @@ class SportsPress_Widget_Calendar extends WP_Widget {
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_action( 'widgets_init', create_function( '', 'return register_widget( "SportsPress_Widget_Calendar" );' ) );
|
add_action( 'widgets_init', create_function( '', 'return register_widget( "SportsPress_Widget_Events_Calendar" );' ) );
|
||||||
@@ -1,22 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
class SportsPress_Widget_Events extends WP_Widget {
|
class SportsPress_Widget_Future_Events extends WP_Widget {
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$widget_ops = array('classname' => 'widget_recent_entries widget_sp_events', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
$widget_ops = array('classname' => 'widget_recent_entries widget_sp_future_events', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
||||||
parent::__construct('sp_events', __( 'Events', 'sportspress' ), $widget_ops);
|
parent::__construct('sp_future_events', __( 'Future Events', 'sportspress' ), $widget_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __( 'Future Events' ) : $instance['title'], $instance, $this->id_base);
|
||||||
$status = empty($instance['status']) ? null : $instance['status'];
|
|
||||||
$league = empty($instance['league']) ? null : $instance['league'];
|
$league = empty($instance['league']) ? null : $instance['league'];
|
||||||
$season = empty($instance['season']) ? null : $instance['season'];
|
$season = empty($instance['season']) ? null : $instance['season'];
|
||||||
$venue = empty($instance['venue']) ? null : $instance['venue'];
|
$venue = empty($instance['venue']) ? null : $instance['venue'];
|
||||||
$team = empty($instance['team']) ? null : $instance['team'];
|
$team = empty($instance['team']) ? null : $instance['team'];
|
||||||
$number = empty($instance['number']) ? get_option( 'posts_per_page' ) : $instance['number'];
|
$number = empty($instance['number']) ? get_option( 'posts_per_page' ) : $instance['number'];
|
||||||
$args = array(
|
$args = array(
|
||||||
'status' => $status,
|
'status' => 'future',
|
||||||
'league' => $league,
|
'league' => $league,
|
||||||
'season' => $season,
|
'season' => $season,
|
||||||
'venue' => $venue,
|
'venue' => $venue,
|
||||||
@@ -26,7 +25,7 @@ class SportsPress_Widget_Events extends WP_Widget {
|
|||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
if ( $title )
|
if ( $title )
|
||||||
echo $before_title . $title . $after_title;
|
echo $before_title . $title . $after_title;
|
||||||
echo '<div id="sp_events_wrap">';
|
echo '<div id="sp_future_events_wrap">';
|
||||||
echo sportspress_events( $args );
|
echo sportspress_events( $args );
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
@@ -35,7 +34,6 @@ class SportsPress_Widget_Events extends WP_Widget {
|
|||||||
function update( $new_instance, $old_instance ) {
|
function update( $new_instance, $old_instance ) {
|
||||||
$instance = $old_instance;
|
$instance = $old_instance;
|
||||||
$instance['title'] = strip_tags($new_instance['title']);
|
$instance['title'] = strip_tags($new_instance['title']);
|
||||||
$instance['status'] = strip_tags($new_instance['status']);
|
|
||||||
$instance['league'] = intval($new_instance['league']);
|
$instance['league'] = intval($new_instance['league']);
|
||||||
$instance['season'] = intval($new_instance['season']);
|
$instance['season'] = intval($new_instance['season']);
|
||||||
$instance['venue'] = intval($new_instance['venue']);
|
$instance['venue'] = intval($new_instance['venue']);
|
||||||
@@ -46,9 +44,8 @@ class SportsPress_Widget_Events extends WP_Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function form( $instance ) {
|
function form( $instance ) {
|
||||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'status' => '', 'league' => '', 'season' => '', 'venue' => '', 'team' => '', 'number' => 3 ) );
|
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'league' => '', 'season' => '', 'venue' => '', 'team' => '', 'number' => 3 ) );
|
||||||
$title = strip_tags($instance['title']);
|
$title = strip_tags($instance['title']);
|
||||||
$status = strip_tags($instance['status']);
|
|
||||||
$league = intval($instance['league']);
|
$league = intval($instance['league']);
|
||||||
$season = intval($instance['season']);
|
$season = intval($instance['season']);
|
||||||
$venue = intval($instance['venue']);
|
$venue = intval($instance['venue']);
|
||||||
@@ -58,20 +55,6 @@ class SportsPress_Widget_Events extends WP_Widget {
|
|||||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||||
|
|
||||||
<p><label for="<?php echo $this->get_field_id('status'); ?>"><?php _e( 'Status:', 'sportspress' ); ?></label>
|
|
||||||
<?php
|
|
||||||
$options = array(
|
|
||||||
'any' => __( 'Any', 'sportspress' ),
|
|
||||||
'played' => __( 'Played', 'sportspress' ),
|
|
||||||
'scheduled' => __( 'Scheduled', 'sportspress' ),
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
<select id="<?php echo $this->get_field_id('status'); ?>" name="<?php echo $this->get_field_name('status'); ?>" class="widefat">
|
|
||||||
<?php foreach( $options as $key => $name ): ?>
|
|
||||||
<option value="<?php echo $key; ?>" <?php selected ( $key, $status ); ?>><?php echo $name; ?></option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p><label for="<?php echo $this->get_field_id('league'); ?>"><?php _e( 'League:', 'sportspress' ); ?></label>
|
<p><label for="<?php echo $this->get_field_id('league'); ?>"><?php _e( 'League:', 'sportspress' ); ?></label>
|
||||||
<?php
|
<?php
|
||||||
$args = array(
|
$args = array(
|
||||||
@@ -142,4 +125,4 @@ class SportsPress_Widget_Events extends WP_Widget {
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_action( 'widgets_init', create_function( '', 'return register_widget( "SportsPress_Widget_Events" );' ) );
|
add_action( 'widgets_init', create_function( '', 'return register_widget( "SportsPress_Widget_Future_Events" );' ) );
|
||||||
@@ -3,7 +3,7 @@ class SportsPress_Widget_League_Table extends WP_Widget {
|
|||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$widget_ops = array('classname' => 'widget_league_table widget_sp_league_table', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
$widget_ops = array('classname' => 'widget_league_table widget_sp_league_table', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
||||||
parent::__construct('sp_table', __( 'League Table', 'sportspress' ), $widget_ops);
|
parent::__construct('sp_league_table', __( 'League Table', 'sportspress' ), $widget_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
128
admin/widgets/recent-events.php
Normal file
128
admin/widgets/recent-events.php
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?php
|
||||||
|
class SportsPress_Widget_Recent_Events extends WP_Widget {
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
$widget_ops = array('classname' => 'widget_recent_entries widget_sp_recent_events', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
|
||||||
|
parent::__construct('sp_recent_events', __( 'Recent Events', 'sportspress' ), $widget_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
function widget( $args, $instance ) {
|
||||||
|
extract($args);
|
||||||
|
$title = apply_filters('widget_title', empty($instance['title']) ? __( 'Recent Events' ) : $instance['title'], $instance, $this->id_base);
|
||||||
|
$league = empty($instance['league']) ? null : $instance['league'];
|
||||||
|
$season = empty($instance['season']) ? null : $instance['season'];
|
||||||
|
$venue = empty($instance['venue']) ? null : $instance['venue'];
|
||||||
|
$team = empty($instance['team']) ? null : $instance['team'];
|
||||||
|
$number = empty($instance['number']) ? get_option( 'posts_per_page' ) : $instance['number'];
|
||||||
|
$args = array(
|
||||||
|
'status' => 'publish',
|
||||||
|
'league' => $league,
|
||||||
|
'season' => $season,
|
||||||
|
'venue' => $venue,
|
||||||
|
'team' => $team,
|
||||||
|
'number' => $number,
|
||||||
|
);
|
||||||
|
echo $before_widget;
|
||||||
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
|
echo '<div id="sp_recent_events_wrap">';
|
||||||
|
echo sportspress_events( $args );
|
||||||
|
echo '</div>';
|
||||||
|
echo $after_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update( $new_instance, $old_instance ) {
|
||||||
|
$instance = $old_instance;
|
||||||
|
$instance['title'] = strip_tags($new_instance['title']);
|
||||||
|
$instance['league'] = intval($new_instance['league']);
|
||||||
|
$instance['season'] = intval($new_instance['season']);
|
||||||
|
$instance['venue'] = intval($new_instance['venue']);
|
||||||
|
$instance['team'] = intval($new_instance['team']);
|
||||||
|
$instance['number'] = intval($new_instance['number']);
|
||||||
|
|
||||||
|
return $instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
function form( $instance ) {
|
||||||
|
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'league' => '', 'season' => '', 'venue' => '', 'team' => '', 'number' => 3 ) );
|
||||||
|
$title = strip_tags($instance['title']);
|
||||||
|
$league = intval($instance['league']);
|
||||||
|
$season = intval($instance['season']);
|
||||||
|
$venue = intval($instance['venue']);
|
||||||
|
$team = intval($instance['team']);
|
||||||
|
$number = intval($instance['number']);
|
||||||
|
?>
|
||||||
|
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||||
|
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('league'); ?>"><?php _e( 'League:', 'sportspress' ); ?></label>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'taxonomy' => 'sp_league',
|
||||||
|
'name' => $this->get_field_name('league'),
|
||||||
|
'id' => $this->get_field_id('league'),
|
||||||
|
'selected' => $league,
|
||||||
|
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||||
|
'hide_empty' => 0,
|
||||||
|
'values' => 'term_id',
|
||||||
|
'class' => 'widefat',
|
||||||
|
);
|
||||||
|
wp_dropdown_categories( $args );
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('season'); ?>"><?php _e( 'Season:', 'sportspress' ); ?></label>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'taxonomy' => 'sp_season',
|
||||||
|
'name' => $this->get_field_name('season'),
|
||||||
|
'id' => $this->get_field_id('season'),
|
||||||
|
'selected' => $season,
|
||||||
|
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
|
||||||
|
'hide_empty' => 0,
|
||||||
|
'values' => 'term_id',
|
||||||
|
'class' => 'widefat',
|
||||||
|
);
|
||||||
|
wp_dropdown_categories( $args );
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('venue'); ?>"><?php _e( 'Venue:', 'sportspress' ); ?></label>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'taxonomy' => 'sp_venue',
|
||||||
|
'name' => $this->get_field_name('venue'),
|
||||||
|
'id' => $this->get_field_id('venue'),
|
||||||
|
'selected' => $venue,
|
||||||
|
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Venues', 'sportspress' ) ),
|
||||||
|
'hide_empty' => 0,
|
||||||
|
'values' => 'term_id',
|
||||||
|
'class' => 'widefat',
|
||||||
|
);
|
||||||
|
wp_dropdown_categories( $args );
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('team'); ?>"><?php _e( 'Team:', 'sportspress' ); ?></label>
|
||||||
|
<?php
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'sp_team',
|
||||||
|
'name' => $this->get_field_name('team'),
|
||||||
|
'id' => $this->get_field_id('team'),
|
||||||
|
'selected' => $team,
|
||||||
|
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||||
|
'values' => 'ID',
|
||||||
|
'class' => 'widefat',
|
||||||
|
);
|
||||||
|
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||||
|
sportspress_post_adder( 'sp_table' );
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php printf( __( 'Number of %s to show:', 'sportspress' ), __( 'events', 'sportspress' ) ); ?></label>
|
||||||
|
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3"></p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'widgets_init', create_function( '', 'return register_widget( "SportsPress_Widget_Recent_Events" );' ) );
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
/* SportsPress admin styles */
|
/* SportsPress admin styles */
|
||||||
|
|
||||||
.widget[id*="sp_events-"] .widget-title h4:before,
|
.widget[id*="sp_recent_events-"] .widget-title h4:before,
|
||||||
.widget[id*="sp_calendar-"] .widget-title h4:before,
|
.widget[id*="sp_future_events-"] .widget-title h4:before,
|
||||||
.widget[id*="sp_table-"] .widget-title h4:before {
|
.widget[id*="sp_countdown_timer-"] .widget-title h4:before,
|
||||||
|
.widget[id*="sp_events_calendar-"] .widget-title h4:before,
|
||||||
|
.widget[id*="sp_league_table-"] .widget-title h4:before {
|
||||||
font-family: 'themeboy';
|
font-family: 'themeboy';
|
||||||
speak: none;
|
speak: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -14,6 +16,7 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
content: "\e600";
|
content: "\e600";
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
|
text-shadow: 0 0 0 #00c7ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postbox .inside .sp-data-table-container {
|
.postbox .inside .sp-data-table-container {
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ if ( !function_exists( 'sportspress_dropdown_pages' ) ) {
|
|||||||
$defaults = array(
|
$defaults = array(
|
||||||
'show_option_all' => false,
|
'show_option_all' => false,
|
||||||
'show_option_none' => false,
|
'show_option_none' => false,
|
||||||
|
'show_dates' => false,
|
||||||
'option_all_value' => 0,
|
'option_all_value' => 0,
|
||||||
'option_none_value' => -1,
|
'option_none_value' => -1,
|
||||||
'name' => 'page_id',
|
'name' => 'page_id',
|
||||||
@@ -270,15 +271,16 @@ if ( !function_exists( 'sportspress_dropdown_pages' ) ) {
|
|||||||
'posts_per_page' => -1,
|
'posts_per_page' => -1,
|
||||||
'child_of' => 0,
|
'child_of' => 0,
|
||||||
'sort_order' => 'ASC',
|
'sort_order' => 'ASC',
|
||||||
'sort_column' => 'post_title',
|
'sort_column' => 'post_title',
|
||||||
'hierarchical' => 1,
|
'hierarchical' => 1,
|
||||||
'exclude' => null,
|
'exclude' => null,
|
||||||
'include' => null,
|
'include' => null,
|
||||||
'meta_key' => null,
|
'meta_key' => null,
|
||||||
'meta_value' => null,
|
'meta_value' => null,
|
||||||
'authors' => null,
|
'authors' => null,
|
||||||
'exclude_tree' => null,
|
'exclude_tree' => null,
|
||||||
'post_type' => 'page',
|
'post_type' => 'page',
|
||||||
|
'post_status' => 'publish',
|
||||||
'values' => 'post_name',
|
'values' => 'post_name',
|
||||||
'class' => null,
|
'class' => null,
|
||||||
);
|
);
|
||||||
@@ -292,19 +294,21 @@ if ( !function_exists( 'sportspress_dropdown_pages' ) ) {
|
|||||||
$posts = get_posts( $args );
|
$posts = get_posts( $args );
|
||||||
if ( $posts ):
|
if ( $posts ):
|
||||||
printf( '<select name="%1$s" class="postform %2$s">', $name, $class );
|
printf( '<select name="%1$s" class="postform %2$s">', $name, $class );
|
||||||
if ( $args['show_option_all'] ) {
|
if ( $args['show_option_all'] ):
|
||||||
printf( '<option value="%1$s">%2$s</option>', $args['option_all_value'], $args['show_option_all'] );
|
printf( '<option value="%1$s">%2$s</option>', $args['option_all_value'], $args['show_option_all'] );
|
||||||
}
|
endif;
|
||||||
if ( $args['show_option_none'] ) {
|
if ( $args['show_option_none'] ):
|
||||||
printf( '<option value="%1$s">%2$s</option>', $args['option_none_value'], $args['show_option_none'] );
|
printf( '<option value="%1$s">%2$s</option>', $args['option_none_value'], $args['show_option_none'] );
|
||||||
}
|
endif;
|
||||||
foreach ( $posts as $post ) {
|
foreach ( $posts as $post ):
|
||||||
|
setup_postdata( $post );
|
||||||
if ( $values == 'ID' ):
|
if ( $values == 'ID' ):
|
||||||
printf( '<option value="%s" %s>%s</option>', $post->ID, selected( true, $args['selected'] == $post->ID, false ), $post->post_title );
|
printf( '<option value="%s" %s>%s</option>', $post->ID, selected( true, $args['selected'] == $post->ID, false ), $post->post_title . ( $args['show_dates'] ? ' (' . $post->post_date . ')' : '' ) );
|
||||||
else:
|
else:
|
||||||
printf( '<option value="%s" %s>%s</option>', $post->post_name, selected( true, $args['selected'] == $post->post_name, false ), $post->post_title );
|
printf( '<option value="%s" %s>%s</option>', $post->post_name, selected( true, $args['selected'] == $post->post_name, false ), $post->post_title );
|
||||||
endif;
|
endif;
|
||||||
}
|
endforeach;
|
||||||
|
wp_reset_postdata();
|
||||||
print( '</select>' );
|
print( '</select>' );
|
||||||
return true;
|
return true;
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ define( 'SPORTSPRESS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
|||||||
define( 'SPORTSPRESS_PLUGIN_FILE', __FILE__ );
|
define( 'SPORTSPRESS_PLUGIN_FILE', __FILE__ );
|
||||||
|
|
||||||
// Libraries
|
// Libraries
|
||||||
include dirname( __FILE__ ) . '/lib/eos/eos.class.php' ;
|
require_once dirname( __FILE__ ) . '/lib/eos/eos.class.php' ;
|
||||||
|
|
||||||
// Globals
|
// Globals
|
||||||
include_once dirname( __FILE__ ) . '/admin/globals/continents.php';
|
require_once dirname( __FILE__ ) . '/admin/globals/continents.php';
|
||||||
include_once dirname( __FILE__ ) . '/admin/globals/countries.php';
|
require_once dirname( __FILE__ ) . '/admin/globals/countries.php';
|
||||||
include_once dirname( __FILE__ ) . '/admin/globals/sports.php';
|
require_once dirname( __FILE__ ) . '/admin/globals/sports.php';
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
require_once dirname( __FILE__ ) . '/functions.php';
|
require_once dirname( __FILE__ ) . '/functions.php';
|
||||||
@@ -50,7 +50,7 @@ require_once dirname( __FILE__ ) . '/admin/templates/player-statistics.php';
|
|||||||
require_once dirname( __FILE__ ) . '/admin/templates/team-columns.php';
|
require_once dirname( __FILE__ ) . '/admin/templates/team-columns.php';
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
include dirname( __FILE__ ) . '/admin/settings/settings.php' ;
|
require_once dirname( __FILE__ ) . '/admin/settings/settings.php' ;
|
||||||
|
|
||||||
// Custom post types
|
// Custom post types
|
||||||
require_once dirname( __FILE__ ) . '/admin/post-types/separator.php';
|
require_once dirname( __FILE__ ) . '/admin/post-types/separator.php';
|
||||||
@@ -73,9 +73,11 @@ require_once dirname( __FILE__ ) . '/admin/terms/venue.php';
|
|||||||
require_once dirname( __FILE__ ) . '/admin/terms/position.php';
|
require_once dirname( __FILE__ ) . '/admin/terms/position.php';
|
||||||
|
|
||||||
// Widgets
|
// Widgets
|
||||||
require_once dirname( __FILE__ ) . '/admin/widgets/events.php';
|
require_once dirname( __FILE__ ) . '/admin/widgets/recent-events.php';
|
||||||
require_once dirname( __FILE__ ) . '/admin/widgets/calendar.php';
|
require_once dirname( __FILE__ ) . '/admin/widgets/future-events.php';
|
||||||
require_once dirname( __FILE__ ) . '/admin/widgets/table.php';
|
require_once dirname( __FILE__ ) . '/admin/widgets/countdown-timer.php';
|
||||||
|
require_once dirname( __FILE__ ) . '/admin/widgets/events-calendar.php';
|
||||||
|
require_once dirname( __FILE__ ) . '/admin/widgets/league-table.php';
|
||||||
|
|
||||||
// Typical request actions
|
// Typical request actions
|
||||||
require_once dirname( __FILE__ ) . '/admin/hooks/plugins-loaded.php';
|
require_once dirname( __FILE__ ) . '/admin/hooks/plugins-loaded.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user