From 1ebfefd191039eccb7ebe08e8333f5711c80c6f2 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 27 Apr 2009 09:28:57 +0000 Subject: [PATCH] Move Tag Cloud widget to WP_Widget, see #8441 git-svn-id: https://develop.svn.wordpress.org/trunk@11094 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-widgets.php | 242 +++++++++++++++----------------- 1 file changed, 113 insertions(+), 129 deletions(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 19f13fe2a2..ef7f160f0e 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -331,7 +331,10 @@ class WP_Widget_Calendar extends WP_Widget { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = strip_tags($instance['title']); ?> -

+

-

- -

+

+ + + +

-

- -

+

-

- -
- -
- -

+


+ +
+ +

$number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); if ($r->have_posts()) : ?> - - - - + + + + -

+

-

-

+

+

-

+

-

-

+

+

-

- -

+

-

- -

+

-

- -

+

-

- -

+

-

- -

+

-

- -

+

__( "Your most used tags in cloud format") ); + $this->WP_Widget('tag_cloud', __('Tag Cloud'), $widget_ops); } - if ( $options != $newoptions ) { - $options = $newoptions; - update_option('widget_tag_cloud', $options); + function widget( $args, $instance ) { + extract($args); + $title = empty($instance['title']) ? __('Tags') : apply_filters('widget_title', $instance['title']); + + echo $before_widget; + echo $before_title . $title . $after_title; + wp_tag_cloud(); + echo $after_widget; } - $title = attribute_escape( $options['title'] ); + function update( $new_instance, $old_instance ) { + $instance['title'] = strip_tags(stripslashes($new_instance['title'])); + return $instance; + } + + function form( $instance ) { ?> -

-

- +

'widget_tag_cloud', 'description' => __( "Your most used tags in cloud format") ); - wp_register_sidebar_widget('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud', $widget_ops); - wp_register_widget_control('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud_control' ); + register_widget('WP_Widget_Tag_Cloud'); do_action('widgets_init'); }