From 7f8b7c9859156bc8bc5bd2aa84b8a7ee3c06a7b9 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 5 Sep 2007 21:50:52 +0000 Subject: [PATCH] Basic tag cloud widget. Props Stargazer. fixes #4130 git-svn-id: https://develop.svn.wordpress.org/trunk@6040 602fd350-edb4-49c9-b593-d223f7449a82 --- 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'] ); +?> +

+

+ +