Title: get_post_stati
Published: April 25, 2014
Last modified: February 24, 2026

---

# get_post_stati( array|string $args = array(), string $output, string $operator ): string[]|stdClass[]

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#changelog)

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

Gets a list of post statuses.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#see-also)󠁿

 * [register_post_status()](https://developer.wordpress.org/reference/functions/register_post_status/)

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

 `$args`array|stringoptional

Array or string of post status arguments to compare against properties of the global`
$wp_post_statuses objects`.

Default:`array()`

`$output`stringoptional

The type of output to return, either `'names'` or `'objects'`. Default `'names'`.

`$operator`stringoptional

The logical operation to perform. `'or'` means only one element from the array needs
to match; `'and'` means all elements must match.
 Default `'and'`.

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

 string[]|stdClass[] A list of post status names or objects.

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

    ```php
    function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {
    	global $wp_post_statuses;

    	$field = ( 'names' === $output ) ? 'name' : false;

    	return wp_filter_object_list( $wp_post_statuses, $args, $operator, $field );
    }
    ```

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

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

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

Filters a list of objects, based on a set of key => value arguments.

  |

| Used by | Description | 
| [WP_REST_Menu_Items_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_menu_items_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php` |

Retrieves the nav menu item’s schema, conforming to JSON Schema.

  | 
| [WP_REST_Templates_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_templates_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php` |

Retrieves the block type’ schema, conforming to JSON Schema.

  | 
| [register_and_do_post_meta_boxes()](https://developer.wordpress.org/reference/functions/register_and_do_post_meta_boxes/)`wp-admin/includes/meta-boxes.php` |

Registers the default post meta boxes, and runs the `do_meta_boxes` actions.

  | 
| [WP_Privacy_Requests_Table::get_request_counts()](https://developer.wordpress.org/reference/classes/wp_privacy_requests_table/get_request_counts/)`wp-admin/includes/class-wp-privacy-requests-table.php` |

Counts the number of requests for each status.

  | 
| [WP_Customize_Manager::establish_loaded_changeset()](https://developer.wordpress.org/reference/classes/wp_customize_manager/establish_loaded_changeset/)`wp-includes/class-wp-customize-manager.php` |

Establishes the loaded changeset.

  | 
| [WP_Customize_Manager::import_theme_starter_content()](https://developer.wordpress.org/reference/classes/wp_customize_manager/import_theme_starter_content/)`wp-includes/class-wp-customize-manager.php` |

Imports theme starter content into the customized state.

  | 
| [WP_Customize_Manager::find_changeset_post_id()](https://developer.wordpress.org/reference/classes/wp_customize_manager/find_changeset_post_id/)`wp-includes/class-wp-customize-manager.php` |

Finds the changeset post ID for a given changeset UUID.

  | 
| [wp_get_custom_css_post()](https://developer.wordpress.org/reference/functions/wp_get_custom_css_post/)`wp-includes/theme.php` |

Fetches the `custom_css` post for a given theme.

  | 
| [WP_REST_Post_Statuses_Controller::get_items()](https://developer.wordpress.org/reference/classes/wp_rest_post_statuses_controller/get_items/)`wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php` |

Retrieves all post statuses, depending on user context.

  | 
| [WP_REST_Posts_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Retrieves the post’s schema, conforming to JSON Schema.

  | 
| [WP_REST_Posts_Controller::get_collection_params()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/get_collection_params/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Retrieves the query params for the posts collection.

  | 
| [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.

  | 
| [WP_Posts_List_Table::get_views()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_views/)`wp-admin/includes/class-wp-posts-list-table.php` |  | 
| [WP_Posts_List_Table::__construct()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/__construct/)`wp-admin/includes/class-wp-posts-list-table.php` |

Constructor.

  | 
| [WP_Posts_List_Table::prepare_items()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/prepare_items/)`wp-admin/includes/class-wp-posts-list-table.php` |  | 
| [WP_Query::get_posts()](https://developer.wordpress.org/reference/classes/wp_query/get_posts/)`wp-includes/class-wp-query.php` |

Retrieves an array of posts based on query variables.

  | 
| [get_adjacent_post()](https://developer.wordpress.org/reference/functions/get_adjacent_post/)`wp-includes/link-template.php` |

Retrieves the adjacent post.

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

Retrieves an array of pages (or hierarchical post type items).

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

Inserts or update a post.

  | 
| [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.

  | 
| [redirect_guess_404_permalink()](https://developer.wordpress.org/reference/functions/redirect_guess_404_permalink/)`wp-includes/canonical.php` |

Attempts to guess the correct URL for a 404 request based on query vars.

  |

[Show 16 more](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_post_stati/?output_format=md#)

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

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

## User Contributed Notes

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