'ascendoor-widget ascendoor-blog-trending-carousel-section', 'description' => __( 'Retrive Trending Posts Widgets', 'ascendoor-blog' ), ); parent::__construct( 'ascendoor_blog_trending_posts_carousel_widget', __( 'Ascendoor Trending Posts Widget', 'ascendoor-blog' ), $ascendoor_blog_trending_posts_widget_ops ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $trending_posts_title = ( ! empty( $instance['title'] ) ) ? ( $instance['title'] ) : ''; $trending_posts_title = apply_filters( 'widget_title', $trending_posts_title, $instance, $this->id_base ); $trending_posts_offset = isset( $instance['offset'] ) ? absint( $instance['offset'] ) : ''; $trending_posts_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; echo $args['before_widget']; if ( ! empty( $trending_posts_title ) ) { ?>