'twitter', 'description' => __('Select the twitter account to show.', 'twitter') ); /* Widget control settings. */ $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'twitter-widget' ); /* Create the widget. */ $this->WP_Widget( 'twitter-widget', __('Shock Twitter', 'twitter'), $widget_ops, $control_ops ); } /** * How to display the widget on the screen. */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); $name = $instance['name']; $tw_num = $instance['tweet_num']; /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ echo $before_title . $title . $after_title; printf(__('')); printf(__('')); printf(__('')); /* After widget (defined by themes). */ echo $after_widget; } /** * Update the widget settings. */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['name'] = strip_tags( $new_instance['name'] ); $instance['tweet_num'] = $new_instance['tweet_num']; return $instance; } /** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('Twitter feed', 'twitter'), 'name' => __('Tweet name', 'twitter'), 'tweet_num' => '3'); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

'facebook', 'description' => __('Select the facebook account to show.', 'facebook') ); $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'facebook-widget' ); $this->WP_Widget( 'facebook-widget', __('Shock Facebook', 'facebook'), $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', $instance['title'] ); $name = $instance['name']; $face_height = $instance['height']; $face_width = $instance['width']; echo $before_widget; echo $before_title . $title . $after_title; printf(__('
')); echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['name'] = strip_tags( $new_instance['name'] ); $instance['height'] = $new_instance['height']; $instance['width'] = $new_instance['width']; return $instance; } function form( $instance ) { $defaults = array( 'title' => __('Facebook Activity', 'facebook'), 'name' => __('facebook.com', 'facebook'), 'height' => '300', 'width' => '200'); $instance = wp_parse_args( (array) $instance, $defaults ); ?>