wpseek.com
A WordPress-centric search engine for devs and theme authors



get_available_post_statuses › WordPress Function

Since2.5.0
Deprecatedn/a
get_available_post_statuses ( $type = 'post' )
Parameters:
  • (string) $type The post_type you want the statuses for. Default 'post'.
    Required: No
    Default: 'post'
Returns:
  • (string[]) An array of all the statuses for the supplied post type.
Defined at:
Codex:

Returns all the possible statuses for a post type.



Source

function get_available_post_statuses( $type = 'post' ) {
	$stati = wp_count_posts( $type );

	return array_keys( get_object_vars( $stati ) );
}