/** * Outputs the widget based on the arguments input through the widget controls. * * @since 0.1.0 */ function widget($sidebar, $instance) { extract($sidebar); /* Set the $args for wp_get_archives() to the $instance array. */ $args = $instance; /* Overwrite the $echo argument and set it to false. */ $args['echo'] = false; /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* Arguments for the tab set. */ $args = array('group' => $instance['group'], 'limit' => $instance['limit'], 'type' => $instance['type'], 'order' => $instance['order'], 'orderby' => $instance['orderby']); /* If a title was input by the user, display it. */ if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } echo whistles_get_whistles($args); /* Close the theme's widget wrapper. */ echo $after_widget; }
/** * Shortcode function. This is just a wrapper for whistles_get_whistles(). * * @since 0.1.0 * @access public * @return string */ function whistles_do_shortcode($attr) { return whistles_get_whistles($attr); }