Index: src/wp-includes/category-template.php
===================================================================
--- src/wp-includes/category-template.php	(revision 32985)
+++ src/wp-includes/category-template.php	(working copy)
@@ -808,24 +808,49 @@
 		$font_spread = 1;
 	$font_step = $font_spread / $spread;
 
-	$a = array();
+	$tags_data = array();
 
+	// generate the $tags_data array
 	foreach ( $tags as $key => $tag ) {
 		$count = $counts[ $key ];
-		$real_count = $real_counts[ $key ];
-		$tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#';
-		$tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key;
-		$tag_name = $tags[ $key ]->name;
+		$tag_id = isset( $tag->id ) ? $tag->id : $key;
 
+		$tags_data[] = array(
+			'id'					=> $tag_id,
+			'url'					=> '#' != $tag->link ? esc_url( $tag->link ) : '#',
+			'name'				=> $tag->name,
+			'slug'				=> $tag->slug,
+			'real_count'	=> $real_counts[ $key ],
+			'class'				=> 'tag-link-' . $tag_id,
+			'font_size'		=> $args['smallest'] + ( $count - $min_count ) * $font_step,
+		);
+	}
+
+	/**
+	 * Filter the data used to generate the tag cloud.
+	 *
+	 * @see wp_generate_tag_cloud()
+	 *
+	 * @param array        $tags   An array of term data for each term used in the tag cloud.
+	 */
+	$tags_data = apply_filters( 'wp_generate_tag_cloud_data', $tags_data );
+
+	$a = array();
+
+	// generate the output links array
+	foreach ( $tags_data as $key => $tag_data ) {
+		$tag_link = $tag_data['url'];
+		$tag_name = $tag_data['name'];
+		$tag_class = $tag_data['class'];
+
 		if ( $translate_nooped_plural ) {
-			$title_attribute = sprintf( translate_nooped_plural( $translate_nooped_plural, $real_count ), number_format_i18n( $real_count ) );
+			$title_attribute = sprintf( translate_nooped_plural( $translate_nooped_plural, $tag_data['real_count'] ), number_format_i18n( $tag_data['real_count'] ) );
 		} else {
-			$title_attribute = call_user_func( $args['topic_count_text_callback'], $real_count, $tag, $args );
+			$title_attribute = call_user_func( $args['topic_count_text_callback'], $tag_data['real_count'], $tags[ $key ], $args );
 		}
 
-		$a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $title_attribute ) . "' style='font-size: " .
-			str_replace( ',', '.', ( $args['smallest'] + ( ( $count - $min_count ) * $font_step ) ) )
-			. $args['unit'] . ";'>$tag_name</a>";
+		$a[] = "<a href='" . $tag_data['url'] . "' class='" . $tag_data['class'] . "' title='" . esc_attr( $title_attribute ) . "' style='font-size: " .
+			str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] . ";'>$tag_name</a>";
 	}
 
 	switch ( $args['format'] ) {
