'ascendoor-widget magazine-trending-carousel-section', 'description' => __( 'Retrive Trending Posts Widgets', 'accurate-news' ), ); parent::__construct( 'accurate_news_trending_posts_widget', __( 'Ascendoor Trending Posts Widget', 'accurate-news' ), $accurate_news_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_button_label = ( ! empty( $instance['button_label'] ) ) ? ( $instance['button_label'] ) : ''; $trending_posts_offset = isset( $instance['offset'] ) ? absint( $instance['offset'] ) : ''; $trending_posts_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; $trending_posts_button_link = ( ! empty( $instance['button_link'] ) ) ? ( $instance['button_link'] ) : esc_url( get_category_link( $trending_posts_category ) ); echo $args['before_widget']; if ( ! empty( $trending_posts_title || $trending_posts_button_label ) ) { ?>