get_post_status_object( string $post_status )

Retrieve a post status object by name.

Description Description

See also See also

Top ↑

Parameters Parameters


(string) (Required) The name of a registered post status.

Top ↑

Return Return

(object|null) A post status object.

Top ↑

Source Source

File: wp-includes/post.php

function get_post_status_object( $post_status ) {
	global $wp_post_statuses;

	if ( empty( $wp_post_statuses[ $post_status ] ) ) {
		return null;

	return $wp_post_statuses[ $post_status ];

Top ↑

Changelog Changelog

Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.