Index: theme.php
===================================================================
--- theme.php	(revision 37315)
+++ theme.php	(working copy)
@@ -1832,16 +1832,16 @@
  * @since 3.0.0
  * @see add_theme_support()
  * @param string $feature the feature being added
+ * @param array $args Optional arguments
  * @return bool|void Whether feature was removed.
  */
-function remove_theme_support( $feature ) {
+function remove_theme_support( $feature, $args = array() ) {
 	// Blacklist: for internal registrations not used directly by themes.
 	if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ) ) )
 		return false;
 
-	return _remove_theme_support( $feature );
+	return _remove_theme_support( $feature, $args );
 }
-
 /**
  * Do not use. Removes theme support internally, ignorant of the blacklist.
  *
@@ -1853,35 +1853,79 @@
  * @global Custom_Background   $custom_background
  *
  * @param string $feature
+ * @param array $args Optional arguments
+ * @return bool|void
  */
-function _remove_theme_support( $feature ) {
+function _remove_theme_support( $feature, $args = array() ) {
 	global $_wp_theme_features;
 
+	// Theme support was never added for this feature.
+	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
+		return false;
+	}
+
+	// Partial removal of theme support, such as a particular post format or thumbnails on a specific post type.
+	if ( $args ) {
+		switch ( $feature ) {
+			// Remove the passed arguments from this feature, reassigning those that remain.
+			case 'html5' :
+			case 'post-formats' :
+				$kept_args = array_diff( $_wp_theme_features[ $feature ][0], $args );
+
+				if ( ! empty( $kept_args ) ) {
+					$_wp_theme_features[ $feature ][0] = $kept_args;
+					return true;
+				}
+
+				return false;
+
+			case 'post-thumbnails' :
+				if ( is_bool( $_wp_theme_features['post-thumbnails'] ) ) {
+					$_wp_theme_features['post-thumbnails'] = array();
+					$_wp_theme_features['post-thumbnails'][] = get_post_types_by_support( 'thumbnail' );
+				}
+
+				$kept_args = array_diff( $_wp_theme_features[ $feature ][0], $args );
+
+				if ( ! empty( $kept_args ) ) {
+					$_wp_theme_features[ $feature ][0] = $kept_args;
+					return true;
+				}
+
+				return false;
+
+			default :
+				return false;
+		}
+	}
+
+	// Full removal of theme support.
 	switch ( $feature ) {
 		case 'custom-header-uploads' :
-			if ( ! isset( $_wp_theme_features['custom-header'] ) )
+			if ( ! isset( $_wp_theme_features['custom-header'] ) ) {
 				return false;
+			}
 			add_theme_support( 'custom-header', array( 'uploads' => false ) );
+
 			return; // Do not continue - custom-header-uploads no longer exists.
-	}
 
-	if ( ! isset( $_wp_theme_features[ $feature ] ) )
-		return false;
-
-	switch ( $feature ) {
 		case 'custom-header' :
-			if ( ! did_action( 'wp_loaded' ) )
+			if ( ! did_action( 'wp_loaded' ) ) {
 				break;
+			}
 			$support = get_theme_support( 'custom-header' );
-			if ( $support[0]['wp-head-callback'] )
+			if ( $support[0]['wp-head-callback'] ) {
 				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
+			}
 			remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
 			unset( $GLOBALS['custom_image_header'] );
 			break;
 
+
 		case 'custom-background' :
-			if ( ! did_action( 'wp_loaded' ) )
+			if ( ! did_action( 'wp_loaded' ) ) {
 				break;
+			}
 			$support = get_theme_support( 'custom-background' );
 			remove_action( 'wp_head', $support[0]['wp-head-callback'] );
 			remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
