/** * 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) { echo $args['before_widget'] . $args['before_title']; $title = apply_filters('widget_title', $instance['title']); echo $title . $args['after_title']; $widget = Vertical_Recent_Post_Widget::vsrp($instance); echo $widget . $args['after_widget']; }
function vsrp_shortcode($atts) { $attr = shortcode_atts(array('class' => '', 'vsrp_id' => '0'), $atts); $instance = array('class' => $attr['class'], 'vsrp_id' => $attr['vsrp_id']); echo "<div class=\"{$instance['class']}\">" . Vertical_Recent_Post_Widget::vsrp($instance) . "</div>"; }