'widget_countdown widget_sp_countdown', 'description' => __( 'A clock that counts down to an upcoming event.', 'sportspress' ) ); parent::__construct('sp_countdown', __( 'SportsPress Countdown', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? null : $instance['title'], $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo sportspress_countdown( $instance ); echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['event'] = intval($new_instance['event']); $instance['show_league'] = intval($new_instance['show_league']); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'event' => '', 'show_league' => 0 ) ); $title = strip_tags($instance['title']); $event = intval($instance['event']); $show_league = intval($instance['show_league']); ?>

'sp_event', 'name' => $this->get_field_name('event'), 'id' => $this->get_field_id('event'), 'selected' => $event, 'show_option_all' => __( '(Auto)', 'sportspress' ), 'values' => 'ID', 'class' => 'widefat', 'show_dates' => true, 'post_status' => 'future', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_event', __( 'Add New', 'sportspress' ) ); endif; ?>

>