diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 69c6dc1a1b..f82ed30179 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1095,65 +1095,68 @@ class WP_Widget_Search extends WP_Widget { } /** - * Display archives widget. + * Archives widget class * - * @since 2.2.0 - * - * @param array $args Widget arguments. + * @since 2.8.0 */ -function wp_widget_archives($args) { - extract($args); - $options = get_option('widget_archives'); - $c = $options['count'] ? '1' : '0'; - $d = $options['dropdown'] ? '1' : '0'; - $title = empty($options['title']) ? __('Archives') : apply_filters('widget_title', $options['title']); +class WP_Widget_Archives extends WP_Widget { - echo $before_widget; - echo $before_title . $title . $after_title; + function WP_Widget_Archives() { + $widget_ops = array('classname' => 'widget_archive', 'description' => __( "A monthly archive of your blog's posts") ); + $this->WP_Widget('archives', __('Archives'), $widget_ops); + } - if($d) { + function widget( $args, $instance ) { + extract($args); + $c = $instance['count'] ? '1' : '0'; + $d = $instance['dropdown'] ? '1' : '0'; + $title = empty($instance['title']) ? __('Archives') : apply_filters('widget_title', $instance['title']); + + echo $before_widget; + echo $before_title . $title . $after_title; + + if ( $d ) { ?>
-
-
-
-
+
+
+
+