WordPress.org

Ready to get started?Download WordPress

Forums

tag description instead number of topics? (1 post)

  1. Smrth
    Member
    Posted 4 years ago #

    so.. can i change my tag cloud widget to show tag description instead number of topics?
    do i have something to change in wp-includes/default-widgets.php ?
    i found somethin but dunno if thats it..

    * Tag cloud widget class
     *
     * @since 2.8.0
     */
    class WP_Widget_Tag_Cloud extends WP_Widget {
    
    	function WP_Widget_Tag_Cloud() {
    		$widget_ops = array( 'description' => __( "Your most used tags in cloud format") );
    		$this->WP_Widget('tag_cloud', __('Tag Cloud'), $widget_ops);
    	}
    
    	function widget( $args, $instance ) {
    		extract($args);
    		$title = apply_filters('widget_title', empty($instance['title']) ? __('Tags') : $instance['title']);
    
    		echo $before_widget;
    		if ( $title )
    			echo $before_title . $title . $after_title;
    		echo '<div>';
    		wp_tag_cloud(apply_filters('widget_tag_cloud_args', array()));
    		echo "</div>\n";
    		echo $after_widget;
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance['title'] = strip_tags(stripslashes($new_instance['title']));
    		return $instance;
    	}
    
    	function form( $instance ) {
    ?>
    	<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
    	<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p>
    <?php
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Topic