'atwidget', 'description' => 'Make it wasy for your users to share content to over 300 destinations' ); /* Widget control settings. */ $control_ops = array( 'width' => 325); /* Create the widget. */ $this->WP_Widget( 'addthis-widget', 'AddThis Widget', $widget_ops, $control_ops ); } /** * Echo's out the content of our widget */ function widget($args, $instance) { extract ( $args ); $addthis_new_styles = _get_style_options(); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ($title) echo $before_title . $title . $after_title; printf(apply_filters('addthis_sidebar_style_output', $addthis_new_styles[$instance['style']]['src']), ''); echo $after_widget; } /** * Update this instance */ function update($new_instance, $old_instance) { global $addthis_new_styles; $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); if (isset($addthis_new_styles[ $new_instance['style'] ] ) ) $instance['style'] = strip_tags($new_instance['style']); return $instance; } /** * The form with the widget options */ function form($instance) { if (empty($instance)) { $instance = array('style'=> '' , 'title' => ''); } $style = (empty( $instance['style'] ) ) ? addthis_style_default : esc_attr($instance['style']); $title = (empty( $instance['title'] ) ) ? '' : esc_attr($instance['title']); global $addthis_new_styles; ?>
$v) { $checked = ''; if ($k === $style) $checked = 'checked="checked"'; echo '