WordPress at Your Fingertips

get_post_stati() WP 1.0

Get a list of post statuses.

No Hooks.


Array. A list of post status names or objects.


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'



Since 3.0.0 Introduced.

Code of get_post_stati() WP 5.8

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

From tag: statuses (of post comment user)

More from category: Other

No comments
    Log In