| | 989 | * Add an already registered post_status to an object type. |
| | 990 | * |
| | 991 | * @package WordPress |
| | 992 | * @subpackage Post |
| | 993 | * @since 3.6.0 |
| | 994 | * @uses $wp_post_statuses Modifies post status object |
| | 995 | * |
| | 996 | * @param string $post_status Name of post status object |
| | 997 | * @param string $object_type Name of the object type |
| | 998 | * @return bool True if successful, false if not |
| | 999 | */ |
| | 1000 | function register_post_status_for_object_type( $post_status, $object_type ) { |
| | 1001 | global $wp_post_statuses; |
| | 1002 | |
| | 1003 | if ( ! isset( $wp_post_statuses[ $post_status ] ) ) |
| | 1004 | return false; |
| | 1005 | |
| | 1006 | if ( ! get_post_type_object( $object_type ) ) |
| | 1007 | return false; |
| | 1008 | |
| | 1009 | if ( ! in_array( $object_type, $wp_post_statuses[ $post_status ]->object_type ) ) |
| | 1010 | $wp_post_statuses[ $post_status ]->object_type[] = $object_type; |
| | 1011 | |
| | 1012 | return true; |
| | 1013 | } |
| | 1014 | |
| | 1015 | /** |