get_available_post_statuses

Advertisement

Summery Summery

Get all the possible statuses for a post_type

Syntax Syntax

get_available_post_statuses( string $type = 'post' )

Parameters Parameters

$type

(Optional) The post_type you want the statuses for. Default 'post'.

Default value: 'post'

Return Return

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

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Advertisement

Leave a Reply