widget_cssclass = 'blog_tale widget_recent_comments'; $this->widget_description = __("Displays recent comments", 'blog-tale'); $this->widget_id = 'blog_tale_recent_comments'; $this->widget_name = __('BT: Recent Comments', 'blog-tale'); $this->settings = array( 'title' => array( 'type' => 'text', 'label' => __('Title', 'blog-tale'), ), 'comments_number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 5, 'label' => __('Number of comments to show', 'blog-tale'), ), ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget($args, $instance){ ob_start(); $this->widget_start($args, $instance); do_action( 'blog_tale_before_recent_comments'); ?>
absint($instance['comments_number']), 'status' => 'approve', 'post_status' => 'publish' ), $instance ) ); $output = ''; echo wp_kses_post($output); ?>
widget_end($args); echo ob_get_clean(); } }