'widget_mfn_recent_posts', 'description' => __('The most recent posts on your site.', 'mfn-opts') ); parent::__construct('widget_mfn_recent_posts', __('Muffin Recent Posts', 'mfn-opts'), $widget_ops); $this->alt_option_name = 'widget_mfn_recent_posts'; } /** * Outputs the HTML for this widget. */ public function widget($args, $instance) { if (! isset($args['widget_id'])) { $args['widget_id'] = null; } extract($args, EXTR_SKIP); echo wp_kses_post($before_widget); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); if ($title) { echo wp_kses($before_title, array('h3'=>array(),'h4'=>array())); echo wp_kses($title, mfn_allowed_html()); echo wp_kses($after_title, array('h3'=>array(),'h4'=>array())); } $args = array( 'posts_per_page' => $instance['count'] ? intval($instance['count']) : 0, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ); if ($instance['category']) { $args['category_name'] = $instance['category']; } if (! isset($instance['style'])) { $instance['style'] = ''; } $query_recent_posts = new WP_Query(apply_filters('widget_posts_args', $args)); if ($query_recent_posts->have_posts()) { echo '