__( 'A Recent Post Widget', 'benevolent' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $benevolent_args Widget arguments. * @param array $benevolent_instance Saved values from database. */ public function widget( $benevolent_args, $benevolent_instance ) { $benevolent_title = $benevolent_instance['title']; $benevolent_num_post = absint( $benevolent_instance['num_post'] ); $benevolent_show_thumb = $benevolent_instance['show_thumbnail']; $benevolent_show_date = $benevolent_instance['show_postdate']; $benevolent_qry = new WP_Query( array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $benevolent_num_post, 'ignore_sticky_posts' => true ) ); if( $benevolent_qry->have_posts() ){ echo $benevolent_args['before_widget']; echo $benevolent_args['before_title'] . apply_filters( 'the_title', $benevolent_title ) . $benevolent_args['after_title']; ?>

/>

/>