Changeset 6040 for trunk/wp-includes/widgets.php
- Timestamp:
- 09/05/2007 09:50:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r6026 r6040 1075 1075 } 1076 1076 1077 function wp_widget_tag_cloud($args) { 1078 extract($args); 1079 $options = get_option('widget_tag_cloud'); 1080 $title = empty($options['title']) ? __('Tags') : $options['title']; 1081 1082 echo $before_widget; 1083 echo $before_title . $title . $after_title; 1084 wp_tag_cloud(); 1085 echo $after_widget; 1086 } 1087 1088 function wp_widget_tag_cloud_control() { 1089 $options = $newoptions = get_option('widget_tag_cloud'); 1090 1091 if ( $_POST['tag-cloud-submit'] ) { 1092 $newoptions['title'] = strip_tags(stripslashes($_POST['tag-cloud-title'])); 1093 } 1094 1095 if ( $options != $newoptions ) { 1096 $options = $newoptions; 1097 update_option('widget_tag_cloud', $options); 1098 } 1099 1100 $title = attribute_escape( $options['title'] ); 1101 ?> 1102 <p><label for="tag-cloud-title"> 1103 <?php _e('Title:') ?> <input type="text" style="width:300px" id="tag-cloud-title" name="tag-cloud-title" value="<?php echo $title ?>" /></label> 1104 </p> 1105 <input type="hidden" name="tag-cloud-submit" id="tag-cloud-submit" value="1" /> 1106 <?php 1107 } 1108 1077 1109 function wp_widgets_init() { 1078 1110 if ( !is_blog_installed() ) … … 1110 1142 wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries', $class); 1111 1143 wp_register_widget_control('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries_control', $dims90); 1144 1145 $class['classname'] = 'widget_tag_cloud'; 1146 wp_register_sidebar_widget('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud', $class); 1147 wp_register_widget_control('tag_cloud', __('Tag Cloud'), 'wp_widget_tag_cloud_control', 'width=300&height=160'); 1112 1148 1113 1149 wp_widget_categories_register();
Note: See TracChangeset
for help on using the changeset viewer.