get_post_stati( array|string $args = array(), string $output = 'names', string $operator = 'and' )
Get a list of post statuses.
描述
参数
- $args
-
(array|string)
(Optional)
Array or string of post status arguments to compare against properties of the global$wp_post_statuses objects
.Default value: array()
- $output
-
(string)
(Optional)
The type of output to return, either 'names' or 'objects'.Default value: 'names'
- $operator
-
(string)
(Optional)
The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match.Default value: 'and'
返回值
(array) A list of post status names or objects.
源代码
File: wp-includes/post.php
function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {
global $wp_post_statuses;
$field = ('names' == $output) ? 'name' : false;
return wp_filter_object_list($wp_post_statuses, $args, $operator, $field);
}
更新日志
Version | 描述 |
---|---|
3.0.0 | Introduced. |
相关函数
Uses
-
wp-includes/functions.php:
wp_filter_object_list()
Used By
-
wp-includes/class-wp-customize-manager.php:
WP_Customize_Manager::import_theme_starter_content() -
wp-includes/class-wp-customize-manager.php:
WP_Customize_Manager::find_changeset_post_id() -
wp-includes/theme.php:
wp_get_custom_css_post() -
wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php:
WP_REST_Post_Statuses_Controller::get_items() -
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
WP_REST_Posts_Controller::get_item_schema() -
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
WP_REST_Posts_Controller::get_collection_params() -
wp-admin/includes/post.php:
wp_edit_posts_query() -
wp-admin/includes/class-wp-posts-list-table.php:
WP_Posts_List_Table::get_views() -
wp-admin/includes/class-wp-posts-list-table.php:
WP_Posts_List_Table::__construct() -
wp-admin/includes/class-wp-posts-list-table.php:
WP_Posts_List_Table::prepare_items() -
wp-includes/class-wp-query.php:
WP_Query::get_posts() -
wp-includes/link-template.php:
get_adjacent_post() -
wp-includes/post.php:
get_pages() -
wp-includes/post.php:
wp_count_posts()
Show 9 more used by
Hide more used by
你可能对这些文章感兴趣:
- wordpress函数get_the_posts_navigation()用法示例
- wordpress函数get_the_title()用法示例
- wordpress函数get_the_terms()用法示例
- wordpress函数get_the_tags()用法示例
- wordpress函数get_the_taxonomies()用法示例
- wordpress函数get_the_permalink()用法示例
- wordpress函数get_the_password_form()用法示例
- wordpress函数get_the_posts_pagination()用法示例
- wordpress函数get_the_modified_date()用法示例
- wordpress函数get_the_modified_time()用法示例
- wordpress函数get_the_modified_author()用法示例
- wordpress函数get_the_guid()用法示例
- wordpress函数get_the_ID()用法示例
- wordpress函数get_the_excerpt()用法示例
如有疑问,请前往问答中心反馈!
反馈