'agency_ecommerce_widget_latest_news', 'description' => esc_html__('Widget to dispaly latest posts with thumbnail, title, short content and read more link', 'agency-ecommerce'), ); parent::__construct('agency-ecommerce-latest-news', esc_html__('AE: Latest News', 'agency-ecommerce'), $opts); } function widget($args, $instance) { $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $post_category = !empty($instance['post_category']) ? $instance['post_category'] : 0; $exclude_categories = !empty($instance['exclude_categories']) ? esc_attr($instance['exclude_categories']) : ''; $excerpt_length = !empty($instance['excerpt_length']) ? $instance['excerpt_length'] : 15; $disable_date = !empty($instance['disable_date']) ? $instance['disable_date'] : 0; echo $args['before_widget']; ?>
'', 'post_category' => '', 'exclude_categories' => '', 'excerpt_length' => 15, 'disable_date' => 0, )); ?>
'name', 'hide_empty' => 0, 'class' => 'widefat', 'taxonomy' => 'category', 'name' => $this->get_field_name('post_category'), 'id' => $this->get_field_id('post_category'), 'selected' => absint($instance['post_category']), 'show_option_all' => esc_html__('All Categories', 'agency-ecommerce'), ); wp_dropdown_categories($cat_args); ?>
id="get_field_id('disable_date'); ?>" name="get_field_name('disable_date'); ?>" />