'att_youtube', 'description' => __('Display a YouTube video')); $control_ops = array(); $this->WP_Widget('att_youtube', __('ATT YouTube'), $widget_ops, $control_ops); } // Display the widget on the web site function widget( $args, $instance ) { extract($args); // Optionally generate the link code echo $before_widget; ?>
'ATinyTeam YouTube Plugin', 'link' => 'http://youtu.be/9LpPZbscjJk', 'width'=>'320', 'height'=>'180', 'size'=> 'custom', 'option1'=> '', 'option2'=> '', 'option3'=> '', 'option4'=> '', ) ); $title = $instance['title']; $link = $instance['link']; $width = $instance['width']; $height = $instance['height']; $size = $instance['size']; $option1 = $instance['option1']; $option2 = $instance['option2']; $option3 = $instance['option3']; $option4 = $instance['option4']; ?>

'att_youtube_title', 'content' => 'att_youtube_content' ); $submit = 'att_youtube_submit'; // Read in existing option value from database $opt_val = array( 'title' => get_option( $opt_name['title']) , 'content' => get_option( $opt_name['content']) ); // See if the user has posted us some information // If they did, this hidden field will be set to 'Save' if(isset($_POST[ $submit ]) && $_POST[ $submit ] == 'Save' ) { // Read their posted value $opt_val = array( 'title' => stripslashes($_POST[ $opt_name['title'] ]), 'content' => stripslashes($_POST[ $opt_name['content'] ]) ); // Save the posted value in the database update_option( $opt_name['title'], $opt_val['title'] ); update_option( $opt_name['content'], $opt_val['content'] ); // Put an options updated message on the screen ?>