get_available_post_statuses( string $type = 'post' )

Get all the possible statuses for a post_type


Description Description


Parameters Parameters

$type

(string) (Optional) The post_type you want the statuses for.

Default value: 'post'


Top ↑

Return Return

(string[]) An array of all the statuses for the supplied post type.


Top ↑

Source Source

File: wp-admin/includes/post.php

function get_available_post_statuses( $type = 'post' ) {
	$stati = wp_count_posts( $type );

	return array_keys( get_object_vars( $stati ) );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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