Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get post stati

This page redirects to an external site: https://developer.wordpress.org/reference/functions/get_post_stati/

This article is marked as in need of editing. You can help Codex by editing it.

Description

Returns an array of post status names or objects.

Usage

<code style="color: #000000"><span style="color: #0000BB"><?php get_post_stati</span><span style="color: #007700">( </span><span style="color: #0000BB">$args</span><span style="color: #007700">, </span><span style="color: #0000BB">$output</span><span style="color: #007700">, </span><span style="color: #0000BB">$operator </span><span style="color: #007700">); </span><span style="color: #0000BB">?></span></code>

Parameters

See wp_filter_object_list() for specific arguments list.

$args
(array/string) (optional) Array of key => value pairs used to filter results
Default: array()
$output
(string) (optional) Whether to output 'names' or 'objects'.
Default: 'names'
$operator
(string) (optional) Whether to return statuses matching ALL ('and') or ANY ('or') arguments.
Default: 'and'

Return Values

An array of post names or objects, depending on $output parameter.

Note: The return value is the $wp_post_statuses global passed through wp_filter_object_list() with parameters passed to the function.

Change Log

  • Since: 3.0.0

Source File

get_post_stati() is located in wp-includes/post.php.

Related

get_post_status(), get_post_statuses, get_post_status_object(), register_post_status()

See also index of Function Reference and index of Template Tags.