'', 'order' => 'DESC', 'orderby' => 'date', 'select' => 'all', 'show' => 6, 'cats' => array(), 'thumbnails' => true, ); /* Widget setup */ function __construct() { /* Widget settings. */ $widget_ops = array( 'description' => _x( 'Blog categories', 'widget', 'the7mk2' ) ); /* Create the widget. */ parent::__construct( 'presscore-blog-categories', DT_WIDGET_PREFIX . _x( 'Blog categories', 'widget', 'the7mk2' ), $widget_ops ); } /* Display the widget */ function widget( $args, $instance ) { extract( $args ); $instance = wp_parse_args( (array) $instance, self::$widget_defaults ); /* Our variables from the widget settings. */ $title = apply_filters( 'widget_title', $instance['title'] ); $cats_args = array( 'show_count' => true, 'hierarchical' => false, 'title_li' => '', 'echo' => false, 'walker' => new Dt_Inc_Classes_WidgetsCategory_Walker() ); switch ( $instance['select'] ) { case 'except' : $cats_args['exclude'] = implode( ',', $instance['cats'] ); break; case 'only' : $cats_args['include'] = implode( ',', $instance['cats'] ); } $cats = wp_list_categories( $cats_args ); echo $before_widget ; // title if ( $title ) echo $before_title . $title . $after_title; echo '