From c5d33cbebd05c880d4babf9bd8c5f46879f0927d Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 5 Sep 2007 21:50:52 +0000 Subject: [PATCH] Basic tag cloud widget. Props Stargazer. fixes #4130 git-svn-id: http://svn.automattic.com/wordpress/trunk@6040 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index de6ce6d3a3..df75348d6d 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1074,6 +1074,38 @@ function wp_widget_rss_register() { add_action('sidebar_admin_page', 'wp_widget_rss_page'); } +function wp_widget_tag_cloud($args) { + extract($args); + $options = get_option('widget_tag_cloud'); + $title = empty($options['title']) ? __('Tags') : $options['title']; + + echo $before_widget; + echo $before_title . $title . $after_title; + wp_tag_cloud(); + echo $after_widget; +} + +function wp_widget_tag_cloud_control() { + $options = $newoptions = get_option('widget_tag_cloud'); + + if ( $_POST['tag-cloud-submit'] ) { + $newoptions['title'] = strip_tags(stripslashes($_POST['tag-cloud-title'])); + } + + if ( $options != $newoptions ) { + $options = $newoptions; + update_option('widget_tag_cloud', $options); + } + + $title = attribute_escape( $options['title'] ); +?> +

+

+ +