'widget_countdown widget_sp_countdown', 'description' => __( 'SportsPress widget.', 'sportspress' ) ); parent::__construct('sp_countdown', __( 'Countdown', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __( 'Countdown', '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; echo sportspress_countdown( $instance ); 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']); ?>
'sp_event', 'name' => $this->get_field_name('id'), 'id' => $this->get_field_id('id'), 'selected' => $id, 'show_option_all' => '(' . __( 'Next Event', 'premier' ) . ')', 'values' => 'ID', 'class' => 'widefat', 'show_dates' => true, 'post_status' => 'future', ); if ( ! sportspress_dropdown_pages( $args ) ): sportspress_post_adder( 'sp_event' ); endif; ?>