'widget_recent_post', 'description' => esc_html__( 'Retrieve Recent posts.', 'busyness' ), ); parent::__construct( 'movie_pro_recent_post', esc_html__( 'WT : Recent Posts', 'busyness' ), $tp_widget_popular_post ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { // outputs the content of the widget if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $tp_title = ( ! empty( $instance['title'] ) ) ? ( $instance['title'] ) : ''; $tp_title = apply_filters( 'widget_title', $tp_title, $instance, $this->id_base ); $tp_number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 3; $tp_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; echo $args['before_widget']; if ( ! empty( $tp_title ) ) { echo $args['before_title'] . esc_html( $tp_title ) . $args['after_title']; } $popular_args = array( 'post_type' => 'post', 'posts_per_page' => absint( $tp_number ), 'order' => 'DESC', 'cat' => absint( $tp_category ), ); echo '
';
endif;
?>