';
$data = sportspress_get_league_table_data( $id );
diff --git a/admin/widgets/events.php b/admin/widgets/events.php
new file mode 100644
index 00000000..a43d0253
--- /dev/null
+++ b/admin/widgets/events.php
@@ -0,0 +1,145 @@
+ 'widget_recent_entries widget_sp_events', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
+ parent::__construct('sp_events', __( 'Events', 'sportspress' ), $widget_ops);
+ }
+
+ function widget( $args, $instance ) {
+ extract($args);
+ $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
+ $status = empty($instance['status']) ? null : $instance['status'];
+ $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' => $status,
+ 'league' => $league,
+ 'season' => $season,
+ 'venue' => $venue,
+ 'team' => $team,
+ 'number' => $number,
+ );
+ echo $before_widget;
+ if ( $title )
+ echo $before_title . $title . $after_title;
+ echo '';
+ echo sportspress_events( $args );
+ echo '
';
+ echo $after_widget;
+ }
+
+ function update( $new_instance, $old_instance ) {
+ $instance = $old_instance;
+ $instance['title'] = strip_tags($new_instance['title']);
+ $instance['status'] = strip_tags($new_instance['status']);
+ $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' => '', 'status' => '', 'league' => '', 'season' => '', 'venue' => '', 'team' => '', 'number' => 3 ) );
+ $title = strip_tags($instance['title']);
+ $status = strip_tags($instance['status']);
+ $league = intval($instance['league']);
+ $season = intval($instance['season']);
+ $venue = intval($instance['venue']);
+ $team = intval($instance['team']);
+ $number = intval($instance['number']);
+?>
+
+
+
+
+ __( 'Any', 'sportspress' ),
+ 'played' => __( 'Played', 'sportspress' ),
+ 'scheduled' => __( 'Scheduled', 'sportspress' ),
+ );
+ ?>
+
+
+
+ '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 );
+ ?>
+
+
+
+ '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 );
+ ?>
+
+
+
+ '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 );
+ ?>
+
+
+
+ '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;
+ ?>
+
+
+
+
+ 'widget_league_table widget_sp_league_table', 'description' => __( 'SportsPress widget.', 'sportspress' ) );
- parent::__construct('sp_table', __( 'League Table', 'sportspress', 'sportspress' ), $widget_ops);
+ parent::__construct('sp_table', __( 'League Table', 'sportspress' ), $widget_ops);
}
function widget( $args, $instance ) {
@@ -35,17 +35,19 @@ class SportsPress_Widget_League_Table extends WP_Widget {
-
+
'sp_table',
'name' => $this->get_field_name('id'),
'id' => $this->get_field_id('id'),
- 'show_option_none' => __( '-- Select --', 'sportspress' ),
'selected' => $id,
'values' => 'ID',
+ 'class' => 'widefat',
);
- sportspress_dropdown_pages( $args );
+ if ( ! sportspress_dropdown_pages( $args ) ):
+ sportspress_post_adder( 'sp_table' );
+ endif;
?>
+
+
\ No newline at end of file
diff --git a/assets/fonts/themeboy.ttf b/assets/fonts/themeboy.ttf
new file mode 100755
index 00000000..0c0606d4
Binary files /dev/null and b/assets/fonts/themeboy.ttf differ
diff --git a/assets/fonts/themeboy.woff b/assets/fonts/themeboy.woff
new file mode 100755
index 00000000..c57642cc
Binary files /dev/null and b/assets/fonts/themeboy.woff differ
diff --git a/functions.php b/functions.php
index c96176bf..9483911b 100644
--- a/functions.php
+++ b/functions.php
@@ -230,13 +230,16 @@ if ( !function_exists( 'sportspress_dropdown_taxonomies' ) ) {
'name' => null,
'selected' => null,
'hide_empty' => false,
- 'value' => 'slug',
+ 'values' => 'slug',
+ 'class' => null,
);
$args = array_merge( $defaults, $args );
$terms = get_terms( $args['taxonomy'], $args );
$name = ( $args['name'] ) ? $args['name'] : $args['taxonomy'];
+ $class = $args['class'];
+ unset( $args['class'] );
if ( $terms ) {
- printf( '