wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_available_post_statuses › WordPress Function

Od2.5.0
Przestarzałyn/a
get_available_post_statuses ( $type = 'post' )
Parametry:
  • (string) $type The post_type you want the statuses for. Default 'post'.
    Wymagane: Nie
    Domyślny: 'post'
Powrót:
  • (string[]) An array of all the statuses for the supplied post type.
Zdefiniowane na:
Codex:

Returns all the possible statuses for a post type.



Źródło

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

	return array_keys( get_object_vars( $stati ) );
}