diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php
index da260bbbcb..9f2b24a46a 100644
--- a/wp-includes/default-widgets.php
+++ b/wp-includes/default-widgets.php
@@ -335,6 +335,48 @@ function wp_widget_calendar_control() {
'widget_calendar', 'description' => __( "A calendar of your blog's posts") );
+ $this->WP_Widget('calendar', __('Calendar'), $widget_ops);
+ }
+
+ function widget( $args, $instance ) {
+ extract($args);
+ $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
+ echo $before_widget . $before_title . $title . $after_title;
+ echo '
';
+ get_calendar();
+ echo '
';
+ echo $after_widget;
+ }
+
+ function update( $new_instance, $old_instance ) {
+ if ( !isset($new_instance['submit']) ) // user clicked cancel?
+ return false;
+
+ $instance = $old_instance;
+ $instance['title'] = strip_tags($new_instance['title']);
+
+ return $instance;
+ }
+
+ function form( $instance ) {
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
+ $title = strip_tags($instance['title']);
+?>
+
+
+ 'widget_calendar', 'description' => __( "A calendar of your blog's posts") );
- wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $widget_ops);
- wp_register_widget_control('calendar', __('Calendar'), 'wp_widget_calendar_control' );
+ new WP_Widget_Calendar();
new WP_Widget_Archives();