Index: post.php
===================================================================
--- post.php	(revision 27894)
+++ post.php	(working copy)
@@ -3041,8 +3041,9 @@
 		$wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where );
 	}
 
-	if ( is_object_in_taxonomy($post_type, 'category') )
-		wp_set_post_categories( $post_ID, $post_category );
+	if ( is_object_in_taxonomy($post_type, 'category') ) {
+		wp_set_post_categories( $post_ID, $post_category, false, $post_type, $post_status );
+	}
 
 	if ( isset( $tags_input ) && is_object_in_taxonomy($post_type, 'post_tag') )
 		wp_set_post_tags( $post_ID, $tags_input );
@@ -3396,12 +3397,18 @@
  * @param int $post_ID Post ID.
  * @param array|int $post_categories Optional. List of categories or ID of category.
  * @param bool $append If true, don't delete existing categories, just add on. If false, replace the categories with the new categories.
+ * @param string $post_type Optional post type
+ * @param string $post_status Optional post status
  * @return bool|mixed
  */
-function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $append = false ) {
+function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $append = false, $post_type = '', $post_status = ''  ) {
 	$post_ID = (int) $post_ID;
-	$post_type = get_post_type( $post_ID );
-	$post_status = get_post_status( $post_ID );
+	if( !$post_type ) {
+		$post_type = get_post_type( $post_ID );
+	}
+	if( !$post_status ) {
+		$post_status = get_post_status( $post_ID );
+	}
 	// If $post_categories isn't already an array, make it one:
 	$post_categories = (array) $post_categories;
 	if ( empty( $post_categories ) ) {
@@ -4270,8 +4277,9 @@
 		$wpdb->update( $wpdb->posts, compact("post_name"), array( 'ID' => $post_ID ) );
 	}
 
-	if ( is_object_in_taxonomy($post_type, 'category') )
-		wp_set_post_categories( $post_ID, $post_category );
+	if ( is_object_in_taxonomy($post_type, 'category') ) {
+		wp_set_post_categories( $post_ID, $post_category, false, $post_type, $post_status );
+	}
 
 	if ( isset( $tags_input ) && is_object_in_taxonomy($post_type, 'post_tag') )
 		wp_set_post_tags( $post_ID, $tags_input );
