'widget_insert_page', 'description' => 'Insert the contents of a page into a sidebar'); $this->WP_Widget ('insert-page', 'Insert a page', $widget_ops); } function widget( $args, $instance ) { extract( $args ); $pageid = empty ($instance['pageid']) ? 0 : $instance['pageid']; if ($pageid && ($pages = get_pages ("include=$pageid"))) echo $before_widget . $pages[0]->post_content . $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Pages' ) : $instance['title']); $pageid = $instance['pageid'] = intval ($new_instance['pageid']); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'pageid' => '', 'title' => '') ); //This is filled by the title of the page, so it will appear after the widget name $title = esc_attr( $instance['title'] ); $pageid = esc_attr( $instance['pageid'] ); //Get the list of pages and turn it into a select list $pages = wp_list_pages( apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0))); //list of pages with