'widget_recent_entries widget_sp_future_events', 'description' => __( 'SportsPress widget.', 'sportspress' ) ); parent::__construct('sp_future_events', __( 'Future Events', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __( 'Future 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' => 'future', 'league' => $league, 'season' => $season, 'venue' => $venue, 'team' => $team, 'number' => $number, ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
'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; ?>