'smartlib-last-articles-widget', 'description' => __("The most recent posts on your site (extended contorls)", 'bootframe-core')); parent::__construct('smartlib-recent-posts', __(ucfirst('bootframe-core') . ' Extended Recent Posts', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'widget_recent_entries_Smartlib'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $cache = wp_cache_get('smartlib-recent-posts', 'widget'); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'bootframe-core') : $instance['title'], $instance, $this->id_base); if (empty($instance['number']) || !$number = absint($instance['number'])) $number = 10; $show_date = isset($instance['show_date']) ? $instance['show_date'] : false; $show_post_thumbnail = isset($instance['show_post_thumbnail']) ? $instance['show_post_thumbnail'] : false; $show_post_author = isset($instance['show_post_author']) ? $instance['show_post_author'] : false; $r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true))); ?>
flush_widget_cache(); $alloptions = wp_cache_get('alloptions', 'options'); if (isset($alloptions['widget_recent_entries'])) delete_option('widget_recent_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('widget_recent_posts', 'widget'); } function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $number = isset($instance['number']) ? absint($instance['number']) : 5; $show_date = isset($instance['show_date']) ? (bool)$instance['show_date'] : false; $show_post_thumbnail = isset($instance['show_post_thumbnail']) ? (bool)$instance['show_post_thumbnail'] : true; $show_post_author = isset($instance['show_post_author']) ? (bool)$instance['show_post_author'] : true; ?>
id="get_field_id('show_date'); ?>" name="get_field_name('show_date'); ?>"/>
id="get_field_id('show_post_thumbnail'); ?>" name="get_field_name('show_post_thumbnail', 'bootframe-core'); ?>"/>
id="get_field_id('show_post_author'); ?>" name="get_field_name('show_post_author'); ?>"/>
'bootframe_one_author', 'description' => __("Short info & avatar", 'bootframe-core')); parent::__construct('bootframe_one-author', __(ucfirst('bootframe-core') . ' One Author Profile', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-one-author'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { wp_reset_postdata(); $title = apply_filters('widget_title', $instance['title']); $author = get_userdata($instance['user_id']); $name = $author->display_name; $avatar = get_avatar($instance['user_id'], $instance['size']); $description = get_the_author_meta('description', $instance['user_id']); $author_link = get_author_posts_url($instance['user_id']); ?>'bootframe_widget_social_icons', 'description' => __("Add social profile icons", 'bootframe-core')); parent::__construct('smartlib-social-icons', __(ucfirst('bootframe-core') . ' Social Icons', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-social-icons'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); $this->form_args = array( 'title', 'facebook', 'gplus', 'twitter', 'youtube', 'pinterest', 'linkedin', 'rss' ); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); echo $args['before_widget']; ?> form_args as $row) { $instance[$row] = strip_tags($new_instance[$row]); } return $instance; } function form($instance) { $form_values = array(); foreach ($this->form_args as $row) { if (array_key_exists($row, $instance)) { $form_values[$row] = $instance[$row]; } else { $form_values[$row] = ''; } } ?>
'smartlib-video_widget', 'description' => __("Displays last posts from the video post format", 'bootframe-core')); parent::__construct('smartlib-recent-video-widget', __(ucfirst('bootframe-core') . ' Recent Video', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-recent-videos-widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $limit = is_int($instance['video_limit']) ? $instance['video_limit'] : 4; echo $args['before_widget']; ?>
'smartlib_gallery_recent_widget', 'description' => __("Displays last posts from the gallery post format", 'bootframe-core')); parent::__construct('smartlib-recent-gallery-widget', __(ucfirst('bootframe-core') . ' Recent Galleries', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-gallery_recent_widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $limit = is_int($instance['gallery_limit']) ? $instance['gallery_limit'] : 4; echo $args['before_widget']; ?>
'smartlib-contact-form-widget', 'description' => __("Display Contact Form 7 form in Your sidebar", 'bootframe-core')); parent::__construct('smartlib-contact-form-widget', __(ucfirst('bootframe-core') . ' Contact Form 7 Form', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-contact-form-widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $cache = wp_cache_get('smartlib-contact-form-widget', 'widget'); $title = apply_filters('widget_title', empty($instance['title']) ? __('Contact Form', 'bootframe-core') : $instance['title'], $instance, $this->id_base); $form_id = isset($instance['form_id']) ? $instance['form_id'] : false; if ($form_id) { $contact_form = get_post($form_id); } ?>
'smartlib-header-section-widget', 'description' => __("Section Header", 'bootframe-core')); parent::__construct('smartlib-header-section-widget', __(ucfirst('bootframe-core') . ' Section Header', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib-header-section-widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $header_subtitle = strlen($instance['header_subtitle']) > 0 ? $instance['header_subtitle'] : ''; $header_align = strlen($instance['header_align']) > 0 ? $instance['header_align'] : 'left'; $header_size = strlen($instance['header_size']) ? $instance['header_size'] : 'large'; ?>
'smartlib_portfolio_items_widget', 'description' => __("Displays last portfolio item", 'bootframe-core')); parent::__construct('smartlib_portfolio_items_widget', __(ucfirst('bootframe-core') . ' Portfolio Items', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib_portfolio_items_widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $limit = is_int($instance['items_limit']) ? $instance['items_limit'] : 4; $portfolio_taxonomy = strlen($instance['portfolio_taxonomy']) > 0 ? (int)$instance['portfolio_taxonomy'] : 0; echo $args['before_widget']; ?>
'smartlib_testimonial_items_widget', 'description' => __("Displays testimonials", 'bootframe-core')); parent::__construct('smartlib_testimonial_items_widget', __(ucfirst('bootframe-core') . ' Testimonials', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib_testimonial_items_widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $columns_per_slide = 2; $query_args = array( 'post_type' => 'smartlib_testimonial', ); $query_testimonial = new WP_Query($query_args); $limit = $query_testimonial->found_posts; ?>
'smartlib-sangar-slider-widget', 'description' => __("Display Sangar Slider in Your sidebar", 'bootframe-core')); parent::__construct('smartlib-sangar-slider-widget', __(ucfirst('bootframe-core') . ' Sangar Slider', 'bootframe-core'), $widget_ops); } function widget($args, $instance) { $slider_id = isset($instance['slider_id']) ? $instance['slider_id'] : false; ?>
'sangar_slider'); $sliders = get_posts($post_args); ?> 'smartlib_last_articles_columns_widget', 'description' => __("Displays the latest articles in Columns", 'bootframe-core')); parent::__construct('smartlib_last_articles_columns_widget', __(ucfirst('bootframe-core') . ' Last Articles in Columns', 'bootframe-core'), $widget_ops); $this->alt_option_name = 'smartlib_last_articles_columns_widget'; add_action('save_post', array($this, 'flush_widget_cache')); add_action('deleted_post', array($this, 'flush_widget_cache')); add_action('switch_theme', array($this, 'flush_widget_cache')); } function widget($args, $instance) { $limit = $instance['items_limit'] ? $instance['items_limit'] : 4; $articles_category = strlen($instance['articles_category']) > 0 ? (int)$instance['articles_category'] : 0; $show_shadow = $instance['show_shadow']; $show_decoration = $instance['show_decoration']; echo $args['before_widget']; echo $args['after_title']; ?> $limit, 'post_type' => 'post', 'post__not_in' => get_option('sticky_posts') ); if ($articles_category > 0) { $query_args = array( 'posts_per_page' => $limit, 'post_type' => 'post', 'cat' => $articles_category ); } $query = new WP_Query($query_args); if ($query->have_posts()) { ?>
>No
>Yes
>No
>Yes