'widget_posts_thumbs', 'description' => __('Posts with thumbnails widget by VPThemes.', 'vpthemes') ); $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'posts-widget' ); //default width = 250 $this->WP_Widget( 'posts-widget', __('Posts with Thumbnails', 'vpthemes'), $widget_ops, $control_ops ); } /*----------------------------------*/ /* Update & Save Settings */ /*----------------------------------*/ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['type'] = strip_tags( $new_instance['type'] ); $instance['count'] = strip_tags( $new_instance['count'] ); return $instance; } /*----------------------------------*/ /* Populate Posts */ /*----------------------------------*/ function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', $instance['title'] ); $type = $instance['type']; $count = $instance['count']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; ?> '', 'type' => 'recent', 'count' => '5'); $instance = wp_parse_args( (array) $instance, $defaults ); ?>