esc_html__( 'Displays popular posts, recent posts comments, tags in a tabbed pane.', 'bam' ), ) // Args ); } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { $nop = ! empty( $instance['nop'] ) ? absint( $instance['nop'] ) : 5; $noc = ! empty( $instance['noc'] ) ? absint( $instance['noc'] ) : 5; ?>

1, 'posts_per_page' => $nop, 'post_status' => 'publish' ); $popular = new WP_Query( $args ); if ( $popular->have_posts() ) : while( $popular-> have_posts() ) : $popular->the_post(); ?>
$noc, 'status' => 'approve' ); $comments_query = new WP_Comment_Query; $comments = $comments_query->query( $args ); if ( $comments ) { foreach ( $comments as $comment ) { ?>