WordPress at a glance

get_post_stati() WP 1.0

Get a list of post statuses.


Array. A list of post status names or objects.

Works based on: wp_filter_object_list()

No Hooks.


get_post_stati( $args, $output, $operator );
Array or string of post status arguments to compare against properties of the global $wp_post_statuses objects.
Default: empty array
The type of output to return, either 'names' or 'objects'.
Default: 'names'
The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match.
Default: 'and'


  • Global. Array. $wp_post_statuses List of post statuses.
  • See: register_post_status()

Список изменений

С версии 3.0.0 Введена.

Code of get_post_stati() WP 5.5.1

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 );

Related Functions

From tag: statuses (of post comment user)

More from category: Other

No comments
    Log In . Register