get_post_stati() – Get a list of post statuses.
You appear to be a bot. Output may be restricted
Description
Get a list of post statuses.
Usage
$string[]|stdClass[] = get_post_stati( $args, $output, $operator );
Parameters
- $args
- ( array|string ) optional – Optional. Array or string of post status arguments to compare against properties of the global `$wp_post_statuses objects`. Default empty array.
- $output
- ( string ) optional default: names – Optional. The type of output to return, either 'names' or 'objects'. Default 'names'.
- $operator
- ( string ) optional default: and – Optional. The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match. Default 'and'.
Returns
string[]|stdClass[] A list of post status names or objects.
Source
File name: wordpress/wp-includes/post.php
Lines:
1 to 7 of 7
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 ); }