Index: post.php
===================================================================
--- post.php	(revision 12021)
+++ post.php	(working copy)
@@ -313,6 +313,30 @@
 }
 
 /**
+ * Update data from a post field based on Post ID.
+ *
+ * Examples of the post field will be, 'post_type', 'post_status', 'post_content', etc.
+ *
+ * The context values are based off of the taxonomy filter functions and
+ * supported values are found within those functions.
+ *
+ * @since 2.9.0
+ * @uses sanitize_post_field()
+ *
+ * @param string $field Post field name
+ * @param id $post Post ID
+ * @return bool Result of UPDATE query
+ */
+function set_post_field($field, $value, $post_id) {
+	global $wpdb;
+
+	$post_id = absint($post_id);
+	$value = sanitize_post_field($field, $value, $post_id, 'db');
+
+	return $wpdb->update($wpdb->posts, array($field => $value), array('ID' => $post_id));
+}
+
+/**
  * Retrieve the mime type of an attachment based on the ID.
  *
  * This function can be used with any post type, but it makes more sense with
