Title: get_available_post_statuses
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_available_post_statuses( string $type = 'post' ): string[]

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#wp--skip-link--target)

Returns all the possible statuses for a post type.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#parameters)󠁿

 `$type`stringoptional

The post_type you want the statuses for. Default `'post'`.

Default:`'post'`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#return)󠁿

 string[] An array of all the statuses for the supplied post type.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#source)󠁿

    ```php
    function get_available_post_statuses( $type = 'post' ) {
    	$statuses = wp_count_posts( $type );

    	return array_keys( get_object_vars( $statuses ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/post.php#L1210)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/post.php#L1210-L1214)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_count_posts()](https://developer.wordpress.org/reference/functions/wp_count_posts/)`wp-includes/post.php` |

Counts number of posts of a post type and if user has permissions to view.

  |

| Used by | Description | 
| [wp_edit_posts_query()](https://developer.wordpress.org/reference/functions/wp_edit_posts_query/)`wp-admin/includes/post.php` |

Runs the query to fetch the posts for listing on the edit posts page.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_available_post_statuses/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_available_post_statuses%2F)
before being able to contribute a note or feedback.