add_action('widgets_init', 'campus_html'); function campus_html() { // function name matches name from add_action register_widget('Campus_HTML'); } class Campus_HTML extends WP_Widget { function Campus_HTML() { // function name matches class name $widget_ops = array( 'classname'=>'campus-html-widget', // class that will be added to li element in widgeted area ul 'description'=>'Campus HTML Widget' // description displayed in admin ); $control_ops = array( 'width'=>200, 'height'=>250, // width of input widget in admin 'id_base'=>'campus-html-widget' // base of id of li element ex. id="example-widget-1" ); $this->WP_Widget('campus-html-widget', 'Campus HTML', $widget_ops, $control_ops); // "Example Widget" will be name in control panel } function widget($args, $instance) { extract($args); // these are our widget options $output = $before_widget; // how input text will be displayed $output .= ''; $output .= '

'.$instance['title'].'

'; $output .= var_dump($instance['campus']); $output .= '

'.$instance['text'].' Continue

'; $output .= $after_widget; echo $output; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['campus'] = $new_instance['campus']; $instance['title'] = $new_instance['title']; $instance['image'] = $new_instance['image']; $instance['text'] = $new_instance['text']; $instance['url'] = $new_instance['url']; return $instance; } function form( $instance ) { $defaults = array( 'campus' => 'peoria', 'title' => 'Title Here', 'image' => '/images/16x9_blank.png', 'text' =>'default text', 'url' => 'http://www.google.com'); $instance = wp_parse_args( (array) $instance, $defaults ); ?>