esc_html__('Thumbnail Posts', 'allure-news'), 'cat' => 0, 'post-number' => 6, 'background_color'=> '#fff', ); return $defaults; } public function __construct() { $opts = array( 'classname' => 'allure-news-thumbnail-post', 'description' => esc_html__('Help to display content in thumbnail image Layout.', 'allure-news'), ); parent::__construct('allure-news-thumbnail-post', esc_html__('Allure News Thumbnail Post', 'allure-news'), $opts); } public function widget($args, $instance) { $instance = wp_parse_args((array)$instance, $this->defaults()); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); echo $args['before_widget']; $cat_id = !empty($instance['cat']) ? $instance['cat'] : ''; $post_number = !empty($instance['post-number']) ? $instance['post-number'] : 6; global $allure_news_theme_options; $hide_read_time = $allure_news_theme_options['allure-news-extra-hide-read-time']; if (!empty($title)) { $cat_class = 'cat-' . $cat_id; ?>
'name', 'hide_empty' => 0, 'id' => $this->get_field_id('cat'), 'name' => $this->get_field_name('cat'), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint($instance['cat']), 'show_option_all' => esc_html__('Show Recent Posts', 'allure-news') ); wp_dropdown_categories($cat_args); ?>