'popular-tabs', 'description' => esc_html__( 'Displays popular posts by number of views and comments in tab format.', 'news' ) ); /* Set up the widget control options. */ $control_options = array( 'width' => 200, 'height' => 350 ); /* Create the widget. */ $this->WP_Widget( 'news-popular-tabs', // $this->id_base __( 'News: Popular Tabs', 'news' ), // $this->name $widget_options, // $this->widget_options $control_options // $this->control_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * * @since 0.1.0 */ function widget( $sidebar, $instance ) { extract( $sidebar ); /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if ( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; ?>
id}-1" ); ?>" class="ui-tabs-panel"> $instance['post_type'], 'ignore_sticky_posts' => true, 'posts_per_page' => intval( $instance['posts_per_page'] ), 'meta_key' => 'Views', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); ?> have_posts() ) : ?>
    have_posts() ) : $loop->the_post(); ?> ', '' ); ?>
id}-2" ); ?>" class="ui-tabs-panel"> $instance['post_type'], 'ignore_sticky_posts' => true, 'posts_per_page' => intval( $instance['posts_per_page'] ), 'orderby' => 'comment_count' ) ); ?> have_posts() ) : ?>
    have_posts() ) : $loop->the_post(); ?> ', '' ); ?>
esc_attr__( 'Most', 'news' ), 'posts_per_page' => 3, 'post_type' => 'post', 'views_tab_title' => esc_attr__( 'Viewed', 'news' ), 'comments_tab_title' => esc_attr__( 'Commented', 'news' ) ); /* Merge the user-selected arguments with the defaults. */ $instance = wp_parse_args( (array) $instance, $defaults ); ?>