'widget_calendar widget_sp_event_calendar', 'description' => __( 'A calendar of events.', 'sportspress' ) ); parent::__construct('sp_event_calendar', __( 'SportsPress Events Calendar', 'sportspress' ), $widget_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $id = empty($instance['id']) ? null : $instance['id']; $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
'; sp_get_template( 'event-calendar.php', array( 'id' => $id, 'caption_tag' => 'caption', 'show_all_events_link' => $show_all_events_link ) ); echo '
'; 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']); $instance['show_all_events_link'] = $new_instance['show_all_events_link']; return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'show_all_events_link' => false ) ); $title = strip_tags($instance['title']); $id = intval($instance['id']); $show_all_events_link = $instance['show_all_events_link']; ?>

'sp_calendar', 'show_option_all' => __( 'All', 'sportspress' ), 'name' => $this->get_field_name('id'), 'id' => $this->get_field_id('id'), 'selected' => $id, 'values' => 'ID', 'class' => 'sp-event-calendar-select widefat', ); if ( ! sp_dropdown_pages( $args ) ): sp_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) ); endif; ?>

>