source/php/Widget/DisplayEvents.php
public function form($instance)
    {
        $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
        $limit = isset( $instance['limit'] ) ? $instance['limit'] : 5;
        $days_ahead = isset( $instance['days_ahead'] ) ? absint( $instance['days_ahead'] ) : 5;
        $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : true;
        $show_image = isset( $instance['show_image'] ) ? (bool) $instance['show_image'] : false;
        $show_content = isset( $instance['show_content'] ) ? (bool) $instance['show_content'] : false;
        $show_location = isset( $instance['show_location'] ) ? (bool) $instance['show_location'] : false;
        $content_limit = isset( $instance['content_limit'] ) ? $instance['content_limit'] : -1;
        ?>
        <p><label for="<?php echo esc_attr($this->get_field_id('title'));?>"><?php esc_attr_e('Title:', 'event-integration'); ?></label>
        <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title);?>"></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('limit'));?>"><?php esc_attr_e('Number of events to show:', 'event-integration'); ?></label>
        <input class="tiny-text" id="<?php echo esc_attr($this->get_field_id('limit')); ?>" name="<?php echo esc_attr($this->get_field_name('limit')); ?>" type="number" value="<?php echo esc_attr($limit);?>"></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('days_ahead'));?>"><?php esc_attr_e('Days interval:', 'event-integration'); ?></label>
        <input id="<?php echo esc_attr($this->get_field_id('days_ahead')); ?>" name="<?php echo esc_attr($this->get_field_name('days_ahead')); ?>" type="number" min="0" size="5" value="<?php echo esc_attr($days_ahead);?>"></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display date', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_image ); ?> id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display featured image', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_location ); ?> id="<?php echo $this->get_field_id( 'show_location' ); ?>" name="<?php echo $this->get_field_name( 'show_location' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_location' ); ?>"><?php _e( 'Display location', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_content ); ?> id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display description', 'event-integration' ); ?></label></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('content_limit'));?>"><?php esc_attr_e('Description letter limit:', 'event-integration'); ?></label>
        <input id="<?php echo esc_attr($this->get_field_id('content_limit')); ?>" name="<?php echo esc_attr($this->get_field_name('content_limit')); ?>" type="number" min="-1" size="5" placeholder="<?php _e( '-1 equals no limit', 'event-integration' ); ?>" value="<?php echo esc_attr($content_limit);?>"></p>

        <?php
    }
public function form($instance)
    {
        $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
        $limit = isset( $instance['limit'] ) ? $instance['limit'] : 5;
        $days_ahead = isset( $instance['days_ahead'] ) ? absint( $instance['days_ahead'] ) : 5;
        $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : true;
        $show_image = isset( $instance['show_image'] ) ? (bool) $instance['show_image'] : false;
        $show_content = isset( $instance['show_content'] ) ? (bool) $instance['show_content'] : false;
        $show_location = isset( $instance['show_location'] ) ? (bool) $instance['show_location'] : false;
        $content_limit = isset( $instance['content_limit'] ) ? $instance['content_limit'] : -1;
        ?>
        <p><label for="<?php echo esc_attr($this->get_field_id('title'));?>"><?php esc_attr_e('Title:', 'event-integration'); ?></label>
        <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title);?>"></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('limit'));?>"><?php esc_attr_e('Number of events to show:', 'event-integration'); ?></label>
        <input class="tiny-text" id="<?php echo esc_attr($this->get_field_id('limit')); ?>" name="<?php echo esc_attr($this->get_field_name('limit')); ?>" type="number" value="<?php echo esc_attr($limit);?>"></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('days_ahead'));?>"><?php esc_attr_e('Days interval:', 'event-integration'); ?></label>
        <input id="<?php echo esc_attr($this->get_field_id('days_ahead')); ?>" name="<?php echo esc_attr($this->get_field_name('days_ahead')); ?>" type="number" min="0" size="5" value="<?php echo esc_attr($days_ahead);?>"></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display date', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_image ); ?> id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display featured image', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_location ); ?> id="<?php echo $this->get_field_id( 'show_location' ); ?>" name="<?php echo $this->get_field_name( 'show_location' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_location' ); ?>"><?php _e( 'Display location', 'event-integration' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_content ); ?> id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" />
        <label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display description', 'event-integration' ); ?></label></p>

        <p><label for="<?php echo esc_attr($this->get_field_id('content_limit'));?>"><?php esc_attr_e('Description letter limit:', 'event-integration'); ?></label>
        <input id="<?php echo esc_attr($this->get_field_id('content_limit')); ?>" name="<?php echo esc_attr($this->get_field_name('content_limit')); ?>" type="number" min="-1" size="5" placeholder="<?php _e( '-1 equals no limit', 'event-integration' ); ?>" value="<?php echo esc_attr($content_limit);?>"></p>

        <?php
    }
Outputs the settings form for the Display Events widget.

@param array $instance Previously saved values from database.