'sp_tabbed_sidebar', 'description' => __( 'Tabbed posts, comments and tags.', 'biscaya' ), ); $this->WP_Widget('sp_tabbed_sidebar', '» Wow Tabbed', $widget_args); add_action( 'sp_tabbed_sidebar_tab-latest', array( &$this, 'latest_tab' ) ); add_action( 'sp_tabbed_sidebar_tab-random', array( &$this, 'random_tab' ) ); add_action( 'sp_tabbed_sidebar_tab-comments', array( &$this, 'comments_tab' ) ); add_action( 'sp_tabbed_sidebar_tab-tags', array( &$this, 'tags_tab' ) ); if ( is_active_widget( false, false, $this->id_base ) ) { add_action( 'wp_head', array( &$this, 'load_js' ) ); } } /** * load_js function. */ public function load_js() { wp_enqueue_script( 'jquery-ui-tabs', null, array( 'jquery-ui-core', 'jquery' ), null, false ); wp_enqueue_script( 'biscaya-tabwidget', null, false ); } /** * get_tabs function. */ public function get_tabs() { $_default_tabs = array( 'latest' => __( 'Latest', 'biscaya' ), 'random' => __( 'Random', 'biscaya' ), 'comments' => __( 'Comments', 'biscaya' ), 'tags' => __( 'Tags', 'biscaya' ), ); return apply_filters( 'sp_tabbed_sidebar_tabs', $_default_tabs ); } /** * widget function. */ public function widget( $args, $instance ) { global $wpdb; extract( $args, EXTR_SKIP ); $this->postcount = $instance[ 'postcount' ]; $this->commentcount = $instance[ 'commentcount' ]; $this->display_thumbs = $instance[ 'display_thumbs' ]; if ( !$instance[ 'order' ] ) $instance[ 'order' ] = $this->get_tabs(); if ( $instance[ 'display_home' ] && !is_home() ) return false; ?> $this->display_thumbs, 'show_excerpt' => false, 'query' => array ( 'posts_per_page' => $this->postcount ) ) ); } public function random_tab() { biscaya_widgets_post_loop( 'sidebar-random', array( 'show_thumbs' => $this->display_thumbs, 'show_excerpt' => false, 'query' => array ( 'posts_per_page' => $this->postcount, 'orderby' => 'rand', ) ) ); } public function comments_tab() { $comments = get_comments( array( 'status' => 'approve', 'number' => $this->commentcount ) ); if ($comments) { echo '
'; } } public function tags_tab() { echo '
/>
get_tabs(); if ( !$selected ) $selected = $default; foreach ( $opts as $id => $val ) { echo ''; } } public function render_sidebar_tabs( $order ) { $order = array_unique( $order ); $list = $this->get_tabs(); foreach ( $order as $t => $id ) : ?>