/**
  * widget()
  *
  * @param array $args
  * @param array $instance
  * @return void
  **/
 function widget($args, $instance)
 {
     if (is_admin()) {
         return;
     }
     extract($args, EXTR_SKIP);
     $instance = wp_parse_args($instance, author_image::defaults());
     extract($instance, EXTR_SKIP);
     if ($always) {
         $author_id = author_image::get_single_id();
     } elseif (in_the_loop()) {
         $author_id = get_the_author_meta('ID');
     } elseif (is_singular()) {
         global $wp_the_query;
         $author_id = $wp_the_query->posts[0]->post_author;
     } elseif (is_author()) {
         global $wp_the_query;
         $author_id = $wp_the_query->get_queried_object_id();
     } else {
         return;
     }
     if (!$author_id) {
         return;
     }
     $image = author_image::get($author_id, $instance, $width, $height);
     if (!$image) {
         return;
     }
     $desc = $bio ? trim(get_user_meta($author_id, 'description', true)) : false;
     $title = apply_filters('widget_title', $title);
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo $image . "\n";
     if ($desc) {
         echo apply_filters('author_image_bio', wpautop($desc));
     }
     echo $after_widget;
 }