get_available_post_statuses() WP 2.5.0
Get all the possible statuses for a post_type
Хуков нет.
Возвращает
Строку[]. An array of all the statuses for the supplied post type.
Использование
get_available_post_statuses( $type );
- $type(строка)
- The post_type you want the statuses for.
По умолчанию: 'post'
Список изменений
С версии 2.5.0 | Введена. |
Код get_available_post_statuses() get available post statuses WP 5.6.2
function get_available_post_statuses( $type = 'post' ) {
$stati = wp_count_posts( $type );
return array_keys( get_object_vars( $stati ) );
}