Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 15676)
+++ wp-includes/taxonomy.php	(working copy)
@@ -70,6 +70,19 @@
 		'show_ui' => false,
 		'_builtin' => true,
 	) ) ;
+
+	register_taxonomy( 'post_mode', array('post', 'page', 'attachment'), array(
+		'hierarchical' => false,
+		'labels' => array(
+			'name' => '',
+			'singular_name' => '',
+		),
+		'query_var' => false,
+		'rewrite' => false,
+		'show_ui' => false,
+		'_builtin' => true,
+		'show_in_nav_menus' => false,
+	) ) ;
 }
 add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
 
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 15676)
+++ wp-includes/post.php	(working copy)
@@ -471,6 +471,45 @@
 }
 
 /**
+ * Retrieve the mode for a post
+ *
+ * @param int|object $post A post
+ *
+ * @return mixed The mode if successful. False if no mode is set.  WP_Error if errors.
+ */
+function get_post_mode( $post ) {
+	$post = get_post($post);
+
+	$mode = wp_get_object_terms( $post->ID, 'post_mode', array('order' => 'none', 'fields' => 'names') );
+
+	if ( is_wp_error($mode) )
+		return $mode;
+
+	if ( empty($mode) )
+		return false;
+
+	return ( str_replace('mode-', '', $mode[0]) );
+}
+
+/**
+ * Assign a mode to a post
+ *
+ * @param int|object $post The post for which to assign a mode
+ * @param string $mode  A mode to assign.  The mode must have already been registered with register_post_mode().
+ * @return mixed WP_Error on error. Array of affected term IDs on success.
+ */
+function set_post_mode( $post, $mode ) {
+	global $wp_post_modes;
+
+	$post = get_post($post);
+
+	if ( empty($post) )
+		return new WP_Error('invalid_post', __('Invalid post'));
+
+	return wp_set_post_terms($post_id, array('mode-' . $mode), 'post_mode');
+}
+
+/**
  * Retrieve the post status based on the Post ID.
  *
  * If the post ID is of an attachment, then the parent post status will be given
