__( 'Aspire Smart FAQ Widget for CATEGORIES', 'text_domain' ), ) // Args ); } /** * 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 ) { // outputs the content of the widget // Two variables are coming in INSTANCE ARRAY , title and limit $title = apply_filters( 'widget_title', $instance['title'] ); $limit = $instance['limit']; $atts['cat_name'] = $title; $atts['limit'] = $limit; echo $args['before_widget'].'

FAQs


'; if ( ! empty( $title ) ){ // Pre define short function is used for widget, for customization please see shortcodes file list_aspfaq_shortcode($atts); } echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { // outputs the options form on admin if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( '', 'text_domain' ); } if ( isset( $instance[ 'limit' ] ) ) { $limit = $instance[ 'limit' ]; } // Printing Form for backend with two fields SLUD and LIMIT ?>

Enter comma seperated multiple categories OR single category slug.

Enter the numeric value that defines FAQs limit.