Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 23299)
+++ wp-includes/post.php	(working copy)
@@ -920,7 +920,7 @@
  * @param array|string $args See above description.
  */
 function register_post_status($post_status, $args = array()) {
-	global $wp_post_statuses;
+	global $wp_post_statuses, $wp_post_types;
 
 	if (!is_array($wp_post_statuses))
 		$wp_post_statuses = array();
@@ -980,6 +980,12 @@
 
 	$wp_post_statuses[$post_status] = $args;
 
+	// Add status to already registered post types
+	if ( ! empty( $wp_post_types ) )
+		foreach ( $wp_post_types as $key => $post_type )
+			if ( ! array_key_exists( $post_status, $post_type->statuses ) )
+				$wp_post_types[ $key ]->statuses[ $post_status ] = $args;
+
 	return $args;
 }
 
@@ -996,13 +1002,29 @@
  * @param string $post_status The name of a registered post status
  * @return object A post status object
  */
-function get_post_status_object( $post_status ) {
+function get_post_status_object( $post_status, $object_type = null ) {
 	global $wp_post_statuses;
 
-	if ( empty($wp_post_statuses[$post_status]) )
-		return null;
+	$status_object = null;
 
-	return $wp_post_statuses[$post_status];
+	if ( $object_type ) {
+		$post_type = get_post_type_object( $object_type );
+		if ( $post_type && ! empty( $post_type->statuses[ $post_status ] ) )
+			$status_object = $post_type->statuses[ $post_status ];
+	}
+
+	if ( ! empty( $wp_post_statuses[ $post_status ] ) )
+		$status = $wp_post_statuses[ $post_status ];
+
+	// Search across all post types
+	foreach ( get_post_types( array(), 'objects' ) as $post_type ) {
+		if ( ! empty( $post_type->statuses[ $post_status ] ) ) {
+			$status_object = $post_type->statuses[ $post_status ];
+			break;
+		}
+	}
+
+	return $status_object;
 }
 
 /**
@@ -1021,12 +1043,22 @@
  *  from the array needs to match; 'and' means all elements must match. The default is 'and'.
  * @return array A list of post status names or objects
  */
-function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {
+function get_post_stati( $args = array(), $output = 'names', $operator = 'and', $object_type = null ) {
 	global $wp_post_statuses;
 
 	$field = ('names' == $output) ? 'name' : false;
 
-	return wp_filter_object_list($wp_post_statuses, $args, $operator, $field);
+	$statuses = $wp_post_statuses;
+
+	if ( ! empty( $args['object_type'] ) ) {
+		$post_type = get_post_type_object( $args['object_type'] );
+		if ( $post_type )
+			$statuses = $post_type->statuses;
+
+		unset( $args['object_type'] );
+	}
+
+	return wp_filter_object_list( $statuses, $args, $operator, $field );
 }
 
 /**
@@ -1211,7 +1243,7 @@
  * @return object|WP_Error the registered post type object, or an error object
  */
 function register_post_type( $post_type, $args = array() ) {
-	global $wp_post_types, $wp_rewrite, $wp;
+	global $wp_post_types, $wp_rewrite, $wp, $wp_post_statuses;
 
 	if ( !is_array($wp_post_types) )
 		$wp_post_types = array();
@@ -1227,6 +1259,7 @@
 		'can_export' => true,
 		'show_in_nav_menus' => null, 'show_in_menu' => null, 'show_in_admin_bar' => null,
 		'delete_with_user' => null,
+		'statuses' => null,
 	);
 	$args = wp_parse_args($args, $defaults);
 	$args = (object) $args;
@@ -1336,6 +1369,19 @@
 	if ( $args->register_meta_box_cb )
 		add_action('add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1);
 
+	if ( null === $args->statuses )
+		$args->statuses = array();
+
+	// @todo: when combined with register_post_status, sanitize $status similar to how register_post_status does it
+	foreach ( $args->statuses as $key => $status )
+		$args->statuses[ $key ] = (object) $status;
+
+	// Legacy post statuses
+	if ( ! empty( $wp_post_statuses ) )
+		foreach ( $wp_post_statuses as $key => $post_status )
+			if ( empty( $args->statuses[ $key ] ) )
+				$args->statuses[ $key ] = $post_status;
+
 	$args->labels = get_post_type_labels( $args );
 	$args->label = $args->labels->name;
 
