Index: wp-includes/user.php
===================================================================
--- wp-includes/user.php	(revision 21932)
+++ wp-includes/user.php	(working copy)
@@ -1309,6 +1309,12 @@
 	}
 	$display_name = apply_filters( 'pre_user_display_name', $display_name );
 
+	if ( empty( $avatar_type ) || $avatar_type != 'custom' )
+		$avatar_type = 'gravatar';
+
+	if ( empty( $custom_avatar ) )
+		$custom_avatar = '';
+
 	if ( empty($description) )
 		$description = '';
 	$description = apply_filters('pre_user_description', $description);
@@ -1475,7 +1481,7 @@
  * @return array
  */
 function _get_additional_user_keys( $user ) {
-	$keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front' );
+	$keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'avatar_type', 'custom_avatar' );
 	return array_merge( $keys, array_keys( _wp_get_user_contactmethods( $user ) ) );
 }
 
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 21932)
+++ wp-includes/media.php	(working copy)
@@ -681,6 +681,40 @@
 }
 
 /**
+ * Resize a custom avatar
+ *
+ * @since 3.5.0
+ * @param string URL to an avatar image to resize
+ * @param int Size of the new avatar image
+ * @return array Array with the URL of the new avatar image
+ */
+function custom_avatar_resize( $url, $size ) {
+	$upload_dir = wp_upload_dir();
+	$file = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $url );
+	$info = pathinfo($file);
+	$dir = $info['dirname'];
+	$ext = $info['extension'];
+	$name = wp_basename($file, ".$ext");
+	$suffix = "{$size}x{$size}";
+	$destfilename = "{$dir}/{$name}-{$suffix}.{$ext}";
+	$custom_avatar = array();
+
+	if ( file_exists( $destfilename ) ) {
+		$custom_avatar['url'] = str_replace( $upload_dir['basedir'], $upload_dir['baseurl'], $destfilename );
+		$custom_avatar['skip'] = true;
+	} else {
+		$file = image_resize( $file, $size, $size, true );
+
+		if ( ! is_wp_error( $file ) ) {
+			$custom_avatar['url'] = str_replace( $upload_dir['basedir'], $upload_dir['baseurl'], $file );
+			$custom_avatar['skip'] = false;
+		}
+	}
+
+	return $custom_avatar;
+}
+
+/**
  * Adds a 'wp-post-image' class to post thumbnails
  * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to
  * dynamically add/remove itself so as to only filter post thumbnails
Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 21932)
+++ wp-includes/formatting.php	(working copy)
@@ -2787,6 +2787,14 @@
 				$value = absint( $value );
 			break;
 
+		case 'avatar_size':
+			$value = absint( $value );
+			if ( $value < 1 )
+				$value = 1;
+			elseif ( $value > 512 )
+				$value = 512;
+			break;
+
 		case 'posts_per_page':
 		case 'posts_per_rss':
 			$value = (int) $value;
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 21932)
+++ wp-includes/pluggable.php	(working copy)
@@ -1575,13 +1575,14 @@
  * Retrieve the avatar for a user who provided a user ID or email address.
  *
  * @since 2.5
- * @param int|string|object $id_or_email A user ID,  email address, or comment object
+ * @param int|string|object $id_or_email A user ID, email address, or comment object
  * @param int $size Size of the avatar image
  * @param string $default URL to a default image to use if no avatar is available
  * @param string $alt Alternative text to use in image tag. Defaults to blank
+ * @param string $avatar_type Override user preference (Used in user-edit.php)
  * @return string <img> tag for the user's avatar
 */
-function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
+function get_avatar( $id_or_email, $size = '', $default = '', $alt = false, $avatar_type = '' ) {
 	if ( ! get_option('show_avatars') )
 		return false;
 
@@ -1590,9 +1591,21 @@
 	else
 		$safe_alt = esc_attr( $alt );
 
-	if ( !is_numeric($size) )
-		$size = '96';
+	if ( empty( $size ) || ! is_numeric( $size ) ) {
+		$size = get_option( 'avatar_size' );
+	} else {
+		$size = absint( $size );
 
+		if ( $size < 1 )
+			$size = 1;
+		elseif ( $size > 512 )
+			$size = 512;
+	}
+ 
+	if ( ! empty( $avatar_type ) )
+		if ( $avatar_type != 'custom' )
+			$avatar_type = 'gravatar';
+
 	$email = '';
 	if ( is_numeric($id_or_email) ) {
 		$id = (int) $id_or_email;
@@ -1612,11 +1625,24 @@
 				$email = $user->user_email;
 		} elseif ( !empty($id_or_email->comment_author_email) ) {
 			$email = $id_or_email->comment_author_email;
+
+			if ( $id = email_exists( $email ) )
+				$user = get_userdata( $id );
 		}
 	} else {
 		$email = $id_or_email;
+
+		if ( $id = email_exists( $email ) )
+			$user = get_userdata( $id );
 	}
 
+	if ( isset( $user ) ) {
+		if ( empty( $avatar_type ) )
+			$avatar_type = $user->avatar_type;
+	} else {
+		$avatar_type = 'gravatar';
+	}
+
 	if ( empty($default) ) {
 		$avatar_default = get_option('avatar_default');
 		if ( empty($avatar_default) )
@@ -1650,22 +1676,47 @@
 	elseif ( strpos($default, 'http://') === 0 )
 		$default = add_query_arg( 's', $size, $default );
 
-	if ( !empty($email) ) {
-		$out = "$host/avatar/";
-		$out .= $email_hash;
-		$out .= '?s='.$size;
-		$out .= '&amp;d=' . urlencode( $default );
+	$img = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />";
+ 
+	if ( $avatar_type == 'custom' ) {
+		$avatar_rating = get_option( 'avatar_rating' );
+		$custom_avatar_rating = get_post_meta( $user->custom_avatar, '_wp_attachment_custom_avatar_rating', true );
 
+		$ratings['G']  = 1;
+		$ratings['PG'] = 2;
+		$ratings['R']  = 3;
+		$ratings['X']  = 4;
+
+		if ( $ratings[ $custom_avatar_rating ] <= $ratings[ $avatar_rating ] ) {
+			$custom_avatar = get_post_meta( $user->custom_avatar, '_wp_attachment_custom_avatar', true );
+
+			if ( empty( $custom_avatar[ $size ] ) ) {
+				$url = wp_get_attachment_image_src( $user->custom_avatar, 'full' );
+
+				// Resize the avatar image
+				$custom_avatar[ $size ] = custom_avatar_resize( $url[0], $size );
+
+				// Update the user meta-data
+				update_post_meta( $user->custom_avatar, '_wp_attachment_custom_avatar', $custom_avatar );
+			}
+
+			$src = $custom_avatar[ $size ]['url'];
+			$img = "<img alt='{$safe_alt}' src='{$src}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
+		}
+	} else if ( !empty($email) ) {
+		$src = "$host/avatar/";
+		$src .= $email_hash;
+		$src .= '?s='.$size;
+		$src .= '&amp;d=' . urlencode( $default );
+
 		$rating = get_option('avatar_rating');
 		if ( !empty( $rating ) )
-			$out .= "&amp;r={$rating}";
+			$src .= "&amp;r={$rating}";
 
-		$avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
-	} else {
-		$avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />";
+		$img = "<img alt='{$safe_alt}' src='{$src}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
 	}
 
-	return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt);
+	return apply_filters('get_avatar', $img, $id_or_email, $size, $default, $alt, $avatar_type);
 }
 endif;
 
Index: wp-admin/includes/misc.php
===================================================================
--- wp-admin/includes/misc.php	(revision 21932)
+++ wp-admin/includes/misc.php	(working copy)
@@ -582,6 +582,60 @@
 <?php
 }
 
+/**
+ * Cleanup a custom avatar
+ *
+ * @since 3.5.0
+ * @param int $attachment_id An attachment ID
+ */
+function custom_avatar_cleanup( $attachment_id ) {
+	$upload_dir = wp_upload_dir();
+	$custom_avatar = get_post_meta( $attachment_id, '_wp_attachment_custom_avatar', true );
+
+	if ( is_array( $custom_avatar ) ) {
+		foreach ( $custom_avatar as $file ) {
+			if ( ! $file['skip'] ) {
+				$file = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $file['url'] );
+				@unlink( $file );
+			}
+		}
+	}
+
+	delete_post_meta( $attachment_id, '_wp_attachment_custom_avatar' );
+	delete_post_meta( $attachment_id, '_wp_attachment_custom_avatar_rating' );
+	delete_post_meta( $attachment_id, '_wp_attachment_is_custom_avatar' );
+}
+
+/**
+ * Delete a custom avatar
+ *
+ * @since 3.5.0
+ * @param int $attachment_id An attachment ID
+ */
+function delete_custom_avatar( $attachment_id ) {
+	$is_custom_avatar = get_post_meta( $attachment_id, '_wp_attachment_is_custom_avatar', true );
+
+	if ( ! $is_custom_avatar )
+		return;
+
+	custom_avatar_cleanup( $attachment_id );
+
+	$args = array(
+		'meta_key' => 'custom_avatar',
+		'meta_value' => $attachment_id
+	);
+
+	$users = get_users( $args );
+
+	foreach ( $users as $user ) {
+		// Update the user meta-data
+		update_user_meta( $user->ID, 'avatar_type', 'gravatar' );
+		delete_user_meta( $user->ID, 'custom_avatar' );
+	}
+}
+
+add_action( 'delete_attachment', 'delete_custom_avatar' );
+
 function _ipad_meta() {
 	if ( wp_is_mobile() ) {
 		?>
Index: wp-admin/includes/schema.php
===================================================================
--- wp-admin/includes/schema.php	(revision 21932)
+++ wp-admin/includes/schema.php	(working copy)
@@ -482,6 +482,7 @@
 
 	// 3.5
 	'link_manager_enabled' => 0,
+	'avatar_size' => 96
 	);
 
 	// 3.3
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 21932)
+++ wp-admin/includes/template.php	(working copy)
@@ -1518,6 +1518,10 @@
 	$media_states = array();
 	$stylesheet = get_option('stylesheet');
 
+	$meta_avatar = get_post_meta( $post->ID, '_wp_attachment_is_custom_avatar', true );
+	if ( ! empty( $meta_avatar ) )
+		$media_states[] = __( 'Avatar Image' );
+
 	if ( current_theme_supports( 'custom-header') ) {
 		$meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true );
 		if ( ! empty( $meta_header ) && $meta_header == $stylesheet )
@@ -1536,11 +1540,13 @@
 		$state_count = count( $media_states );
 		$i = 0;
 		echo ' - ';
+		echo '<span class="post-state">';
 		foreach ( $media_states as $state ) {
 			++$i;
 			( $i == $state_count ) ? $sep = '' : $sep = ', ';
-			echo "<span class='post-state'>$state$sep</span>";
+			echo $state . $sep;
 		}
+		echo '</span>';
 	}
 }
 
Index: wp-admin/includes/user.php
===================================================================
--- wp-admin/includes/user.php	(revision 21932)
+++ wp-admin/includes/user.php	(working copy)
@@ -94,6 +94,73 @@
 		$user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
 		$user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
 		$user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
+		$user->avatar_type = isset( $_POST['avatar_type'] ) ? sanitize_text_field( $_POST['avatar_type'] ) : 'gravatar';
+
+		if ( isset( $userdata->custom_avatar ) ) {
+			$user->custom_avatar = $userdata->custom_avatar;
+			$custom_avatar_rating = isset( $_POST['custom_avatar_rating'] ) ? sanitize_text_field( $_POST['custom_avatar_rating'] ) : 'G';
+
+			// Update the user meta-data
+			update_post_meta( $user->custom_avatar, '_wp_attachment_custom_avatar_rating', $custom_avatar_rating );
+		}
+
+		// Add a new avatar
+		if ( isset( $_POST['upload-avatar'] ) && $_POST['upload-avatar'] ) {
+			if ( isset( $user->custom_avatar ) ) {
+				// Reset the current avatar
+				custom_avatar_cleanup( $user->custom_avatar );
+			}
+
+			$mimes = array(
+				'bmp'   =>  'image/bmp',
+				'gif'   =>  'image/gif',
+				'jpeg'  =>  'image/jpeg',
+				'jpg'   =>  'image/jpeg',
+				'jpe'   =>  'image/jpeg',
+				'png'   =>  'image/png',
+				'tiff'  =>  'image/tiff',
+				'tif'   =>  'image/tiff'
+			);
+
+			$overrides = array( 'mimes' => $mimes, 'test_form' => false );
+			$file = wp_handle_upload( $_FILES['import'], $overrides );
+
+			if ( isset( $file['error'] ) )
+				wp_die( $file['error'],  __( 'Image Upload Error' ) );
+
+			$url = $file['url'];
+			$type = $file['type'];
+			$file = $file['file'];
+			$filename = basename($file);
+
+			// Construct the object array
+			$object = array(
+				'guid'           => $url,
+				'post_content'   => $url,
+				'post_mime_type' => $type,
+				'post_title'     => $filename
+			);
+
+			// Save the data
+			$attachment_id = wp_insert_attachment( $object, $file );
+
+			// Add the attachment meta-data
+			wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
+
+			$size = get_option( 'avatar_size' );
+			$custom_avatar = array();
+
+			// Resize the avatar image to default size
+			$custom_avatar[ $size ] = custom_avatar_resize( $url, $size );
+
+			update_post_meta( $attachment_id, '_wp_attachment_custom_avatar', $custom_avatar );
+			update_post_meta( $attachment_id, '_wp_attachment_custom_avatar_rating', 'G' );
+			update_post_meta( $attachment_id, '_wp_attachment_is_custom_avatar', true );
+
+			// Add the user meta-data
+			$user->avatar_type = 'custom';
+			$user->custom_avatar = $attachment_id;
+		}
 	}
 
 	$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
Index: wp-admin/options-discussion.php
===================================================================
--- wp-admin/options-discussion.php	(revision 21932)
+++ wp-admin/options-discussion.php	(working copy)
@@ -243,6 +243,18 @@
 
 </fieldset></td>
 </tr>
+<tr valign="top">
+	<th scope="row"><?php _e( 'Avatar Size' ) ?></th>
+	<td>
+		<fieldset>
+			<legend class="screen-reader-text"><span><?php _e( 'Avatar Size' ); ?></span></legend>
+			<label>
+				<?php _e( 'Size of the avatar image' ); ?>
+				<input name="avatar_size" type="number" step="1" min="0" value="<?php form_option( 'avatar_size' ); ?>" class="small-text" />
+			</label>
+		</fieldset>
+	</td>
+</tr>
 <?php do_settings_fields('discussion', 'avatars'); ?>
 </table>
 
Index: wp-admin/options.php
===================================================================
--- wp-admin/options.php	(revision 21932)
+++ wp-admin/options.php	(working copy)
@@ -60,7 +60,7 @@
 
 $whitelist_options = array(
 	'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
-	'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
+	'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'avatar_size', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
 	'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
 	'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
 	'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format' )
Index: wp-admin/user-edit.php
===================================================================
--- wp-admin/user-edit.php	(revision 21932)
+++ wp-admin/user-edit.php	(working copy)
@@ -147,6 +147,26 @@
 	exit;
 }
 
+case 'remove-avatar':
+check_admin_referer( 'update-user_' . $user_id );
+
+if ( ! current_user_can( 'edit_user', $user_id ) )
+	wp_die( __( 'You do not have permission to edit this user.' ) );
+
+$custom_avatar = get_user_meta( $user_id, 'custom_avatar', true );
+
+custom_avatar_cleanup( $custom_avatar );
+update_user_meta( $user_id, 'avatar_type', 'gravatar' );
+delete_user_meta( $user_id, 'custom_avatar' );
+
+$redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );
+
+if ( $wp_http_referer )
+	$redirect = add_query_arg( 'wp_http_referer', urlencode( $wp_http_referer ), $redirect);
+
+wp_redirect( $redirect );
+exit;
+
 default:
 $profileuser = get_user_to_edit($user_id);
 
@@ -189,7 +209,7 @@
 } ?>
 </h2>
 
-<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>
+<form enctype="multipart/form-data" id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>
 <?php wp_nonce_field('update-user_' . $user_id) ?>
 <?php if ( $wp_http_referer ) : ?>
 	<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
@@ -362,6 +382,99 @@
 ?>
 </table>
 
+<h3><?php _e( 'Avatar' ); ?></h3>
+
+<?php
+$avatar_type = isset( $profileuser->avatar_type ) ? $profileuser->avatar_type : 'gravatar';
+
+if ( isset( $profileuser->custom_avatar ) ) {
+	$custom_avatar_rating = get_post_meta( $profileuser->custom_avatar, '_wp_attachment_custom_avatar_rating', true );
+	$has_custom_avatar = get_post_meta( $profileuser->custom_avatar, '_wp_attachment_is_custom_avatar', true );
+}
+
+if ( ! isset( $custom_avatar_rating ) )
+	$custom_avatar_rating = 'G';
+
+if ( ! isset( $has_custom_avatar ) )
+	$has_custom_avatar = false;
+?>
+
+<table class="form-table">
+<tr>
+	<th><?php _e( 'Display this avatar' ); ?></th>
+	<td class="avatar-picker">
+		<fieldset>
+			<legend class="screen-reader-text"><span><?php _e( 'Display this avatar' ); ?></span></legend>
+			<label>
+				<input <?php checked( $avatar_type, 'gravatar' ); ?> name="avatar_type" type="radio" value="gravatar" />
+				<?php echo get_avatar( $profileuser->ID, 32, '', false, 'gravatar' ); ?>
+				<?php _e( 'Gravatar' ); ?>
+				<span class="description"><?php _e( '<a href="http://codex.wordpress.org/How_to_Use_Gravatars_in_WordPress" target="_blank">More information</a>' ); ?></span>
+			</label>
+			<?php if ( $has_custom_avatar ) : ?>
+			<br />
+			<label>
+				<input <?php checked( $avatar_type, 'custom' ); ?> name="avatar_type" type="radio" value="custom" />
+				<?php echo get_avatar( $profileuser->ID, 32, '', false, 'custom' ); ?>
+				<?php _e( 'Custom' ); ?>
+			</label>
+			<?php endif; ?>
+			<?php
+			if ( $has_custom_avatar && current_user_can( 'upload_files' ) ) {
+				$href = esc_attr( add_query_arg( array(
+					'action' => 'remove-avatar',
+					'user_id' => $profileuser->ID
+				), self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ) );
+
+				echo '<a class="delete" href="' . wp_nonce_url( $href, 'update-user_' . $user_id ) .'" onclick="return showNotice.warn();">' . __( 'Delete' ) . '</a>';
+			}
+			?>
+		</fieldset>
+	</td>
+</tr>
+<?php if ( current_user_can( 'upload_files' ) ) : ?>
+<tr>
+	<th><?php _e( 'Select Image' ); ?></th>
+	<td>
+		<fieldset>
+			<legend class="screen-reader-text"><span><?php _e( 'Select Image' ); ?></span></legend>
+			<label class="description" for="upload-avatar"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
+			<input name="import" type="file" />
+			<?php submit_button( __( 'Upload' ), 'button', 'upload-avatar', false ); ?>
+		</fieldset>
+	</td>
+</tr>
+<?php endif; ?>
+<?php if ( $has_custom_avatar ) : ?>
+<tr>
+	<th><?php _e( 'Avatar Rating' ); ?></th>
+	<td>
+		<fieldset>
+			<legend class="screen-reader-text"><span><?php _e( 'Avatar Rating' ); ?></span></legend>
+			<?php
+			$ratings = array(
+				/* translators: Content suitability rating: http://bit.ly/89QxZA */
+				'G' => __( 'G &#8212; Suitable for all audiences' ),
+				/* translators: Content suitability rating: http://bit.ly/89QxZA */
+				'PG' => __( 'PG &#8212; Possibly offensive, usually for audiences 13 and above' ),
+				/* translators: Content suitability rating: http://bit.ly/89QxZA */
+				'R' => __( 'R &#8212; Intended for adult audiences above 17' ),
+				/* translators: Content suitability rating: http://bit.ly/89QxZA */
+				'X' => __( 'X &#8212; Even more mature than above' )
+			);
+
+			foreach ( $ratings as $key => $rating ) {
+				$selected = ( $custom_avatar_rating == $key ) ? 'checked="checked"' : '';
+				echo '<label><input ' . $selected . ' name="custom_avatar_rating" type="radio" value="' . esc_attr( $key ) . '" /> ' . $rating . '</label><br />';
+			};
+			?>
+			<span class="description"><?php _e( 'Choose a rating for your custom avatar.' ); ?></span>
+		</fieldset>
+	</td>
+</tr>
+<?php endif; ?>
+</table>
+
 <h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3>
 
 <table class="form-table">
Index: wp-admin/css/colors-fresh.css
===================================================================
--- wp-admin/css/colors-fresh.css	(revision 21932)
+++ wp-admin/css/colors-fresh.css	(working copy)
@@ -833,7 +833,8 @@
 table.widefat span.spam a,
 #dashboard_recent_comments .delete a,
 #dashboard_recent_comments .trash a,
-#dashboard_recent_comments .spam a {
+#dashboard_recent_comments .spam a,
+#profile-page .delete {
 	color: #bc0b0b;
 }
 
@@ -1008,7 +1009,8 @@
 table.widefat .spam a:hover,
 #dashboard_recent_comments .delete a:hover,
 #dashboard_recent_comments .trash a:hover
-#dashboard_recent_comments .spam a:hover {
+#dashboard_recent_comments .spam a:hover,
+#profile-page .delete:hover {
 	color: #f00;
 }
 
Index: wp-admin/css/wp-admin.css
===================================================================
--- wp-admin/css/wp-admin.css	(revision 21932)
+++ wp-admin/css/wp-admin.css	(working copy)
@@ -4788,6 +4788,15 @@
 	width: 15em;
 }
 
+#profile-page .avatar-picker img {
+	margin: 2px 0;
+	vertical-align: middle;
+}
+
+#profile-page .delete {
+	text-decoration: none;
+}
+
 #createuser .form-field input {
 	width: 25em;
 }
Index: wp-admin/css/colors-classic.css
===================================================================
--- wp-admin/css/colors-classic.css	(revision 21932)
+++ wp-admin/css/colors-classic.css	(working copy)
@@ -839,7 +839,8 @@
 table.widefat span.spam a,
 #dashboard_recent_comments .delete a,
 #dashboard_recent_comments .trash a,
-#dashboard_recent_comments .spam a {
+#dashboard_recent_comments .spam a,
+#profile-page .delete {
 	color: #bc0b0b;
 }
 
@@ -951,7 +952,8 @@
 table.widefat .spam a:hover,
 #dashboard_recent_comments .delete a:hover,
 #dashboard_recent_comments .trash a:hover
-#dashboard_recent_comments .spam a:hover {
+#dashboard_recent_comments .spam a:hover,
+#profile-page .delete:hover {
 	color: #f00;
 }
 
