'arras_tabbed_sidebar', 'description' => __('Sidebar containing tabs that displays posts, comments and tags.', 'arras'), ); $this->WP_Widget('arras_tabbed_sidebar', __('Tabbed Sidebar', 'arras'), $widget_args); add_action('arras_tabbed_sidebar_tab-featured', array(&$this, 'featured_tab')); add_action('arras_tabbed_sidebar_tab-latest', array(&$this, 'latest_tab')); add_action('arras_tabbed_sidebar_tab-comments', array(&$this, 'comments_tab')); add_action('arras_tabbed_sidebar_tab-tags', array(&$this, 'tags_tab')); add_action('arras_tabbed_sidebar_tab-popular', array(&$this, 'popular_tab')); } function get_tabs() { $_default_tabs = array( 'featured' => __('Featured', 'arras'), 'latest' => __('Latest', 'arras'), 'comments' => __('Comments', 'arras'), 'tags' => __('Tags', 'arras') ); if ( function_exists('akpc_most_popular') ) { $_default_tabs['popular'] = __('Popular', 'arras'); } return apply_filters('arras_tabbed_sidebar_tabs', $_default_tabs); } function widget($args, $instance) { global $wpdb; extract($args, EXTR_SKIP); $this->query_source = $instance['query']; $this->postcount = $instance['postcount']; $this->commentcount = $instance['commentcount']; $this->display_thumbs = isset($instance['display_thumbs']); if (!$instance['order']) $instance['order'] = $this->get_tabs(); if ($instance['display_home'] && !is_home()) { return false; } ?>
  • '; do_action('arras_tabbed_sidebar_tab-' . $tab); echo '
    '; } ?>
  • query_source) { case 'slideshow': $q = arras_parse_query( arras_get_option('slideshow_cat'), $this->postcount, 0, arras_get_option('slideshow_posttype'), arras_get_option('slideshow_tax') ); break; case 'featured2': $q = arras_parse_query( arras_get_option('featured2_cat'), $this->postcount, 0, arras_get_option('featured2_posttype'), arras_get_option('featured2_tax') ); break; default: $q = arras_parse_query( arras_get_option('featured1_cat'), $this->postcount, 0, arras_get_option('featured1_posttype'), arras_get_option('featured1_tax') ); } $f = new WP_Query($q); if (!$f->have_posts()) { echo '' . __('No posts at the moment. Check back again later!', 'arras') . ''; } else { echo '