function widget($args, $instance) { // Get menu $instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $post_list = $instance['post_list']; if (!$post_list) { $post_list = 'default'; } $add_class = $instance['add_class']; if (!$add_class) { $add_class = ''; } echo $args['before_widget']; if (!empty($instance['title'])) { echo $args['before_title'] . $instance['title'] . $args['after_title']; } $before = $add_class ? "<div class='{$add_class}'>" : ''; $after = $add_class ? "</div>" : ''; require_once dirname(__FILE__) . '/atw-showposts-sc.php'; echo $before . atw_show_posts_shortcode(array('filter' => $post_list)) . $after; echo $args['after_widget']; }
function atw_show_posts_sc($args = '') { require_once dirname(__FILE__) . '/includes/atw-showposts-sc.php'; return atw_show_posts_shortcode($args); }