__( 'Display upcoming events from an iCalendar feed.', 'jetpack' ), 'customize_selective_refresh' => true, ) ); if ( is_active_widget( false, false, $this->id_base ) ) { add_action( 'wp_head', array( $this, 'css' ) ); } } function css() { ?> __( 'Upcoming Events', 'jetpack' ), 'feed-url' => '', 'count' => 3, ); $instance = array_merge( $defaults, (array) $instance ); ?>

get_events( $instance['feed-url'], $instance['count'] ); $events = $this->apply_timezone_offset( $events ); $ical->timezone = null; echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title']; echo esc_html( $instance['title'] ); echo $args['after_title']; } if ( ! $events ) : // nothing to display? ?>

apply_timezone_offset( $events ); } } function upcoming_events_register_widgets() { register_widget( 'Jetpack_Upcoming_Events_Widget' ); } add_action( 'widgets_init', 'upcoming_events_register_widgets' );