'tabbed-widget widget_popular_stories', 'description' => esc_html__( 'Widget to display popular news, recent posts and comments in tab.', 'pt-magazine' ), ); parent::__construct( 'pt-magazine-tabbed-content', esc_html__( 'PT: Tabbed Content', 'pt-magazine' ), $opts ); } function widget( $args, $instance ) { $popular_number = ! empty( $instance['popular_number'] ) ? $instance['popular_number'] : 5; $recent_number = ! empty( $instance['recent_number'] ) ? $instance['recent_number'] : 5; $commented_number = ! empty( $instance['commented_number'] ) ? $instance['commented_number'] : 5; echo $args['before_widget']; ?>
absint( $recent_number ), 'no_found_rows' => true, 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => true, 'post_status' => 'publish', ); $recent_posts = new WP_Query( $recent_args ); if ( $recent_posts->have_posts() ) : while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); ?>

absint( $commented_number ), ); $comments_query = new WP_Comment_Query; $comments = $comments_query->query( $comment_args ); if ( $comments ) : foreach ( $comments as $comment ) { ?>
5, 'recent_number' => 5, 'commented_number' => 5, ) ); ?>