public function widget($args, $instance) { global $wpdb, $post; $title = apply_filters('widget_title', $instance['title']); echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } echo SpritzStarter($instance['number'], $instance['selector'], $style = '', $instance['title']); echo $args['after_widget']; }
function spritz_start($atts) { global $wpdb, $post, $wp_query, $SP; $html = ''; extract(shortcode_atts(array('target' => '', 'selector' => '', 'style' => '', 'title' => ''), $atts)); $data = ''; if ($selector != '') { $data = $selector; } if (!in_array($post->ID, $SP['included'])) { $SP['included'][] = $post->ID; return SpritzStarter($target, $data, $style, $title); } }