/**
  * Main widget function.
  *
  * @since 1.1
  * @author Paul Hughes
  * @param array $args the widget arguments.
  * @param array $instance the widget instance variables.
  * @return void.
  */
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     $title = $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
     tribe_related_posts(false, $instance['count'], false, $instance['only_display_related'], $instance['thumbnails'], $instance['post_type']);
     echo $after_widget;
 }
 /**
  * Main widget function.
  *
  * @since 1.1
  * @author Paul Hughes
  * @param array $args the widget arguments.
  * @param array $instance the widget instance variables.
  * @return void.
  */
 function widget($args, $instance)
 {
     extract($args);
     ob_start();
     tribe_related_posts(false, false, $instance['count'], false, $instance['only_display_related'], $instance['thumbnails'], $instance['post_type']);
     $related = ob_get_clean();
     if ($related) {
         echo $before_widget;
         $title = apply_filters('widget_title', $instance['title']);
         if (!empty($title)) {
             echo $before_title . $title . $after_title;
         }
         echo $related;
         echo $after_widget;
     }
 }