get_post_status_object() - WordPress 函数参考中文文档

返回介绍

get_post_status_object()

发布于 2017-09-10 字数2381 浏览 905 评论 0

get_post_status_object( string $post_status )

Retrieve a post status object by name.


描述


参数

$post_status

(string)
(Required)
The name of a registered post status.


返回值

(object|null) A post status object.


源代码

File: wp-includes/post.php

function get_post_status_object( $post_status ) {
	global $wp_post_statuses;

	if ( empty($wp_post_statuses[$post_status]) )
		return null;

	return $wp_post_statuses[$post_status];
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Used By

  • 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-post-statuses-controller.php:
    WP_REST_Post_Statuses_Controller::get_item_permissions_check()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php:
    WP_REST_Post_Statuses_Controller::get_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::check_read_permission()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::handle_status_param()
  • wp-includes/comment.php:
    wp_handle_comment_submission()
  • wp-admin/includes/post.php:
    _wp_translate_postdata()
  • wp-includes/capabilities.php:
    map_meta_cap()
  • wp-includes/class-wp-customize-manager.php:
    WP_Customize_Manager::save()
  • wp-includes/class-wp.php:
    WP::parse_request()
  • wp-includes/class-wp-query.php:
    WP_Query::get_posts()
  • wp-includes/rewrite.php:
    url_to_postid()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::_insert_post()
  • Show 8 more used by
    Hide more used by


User Contributed Notes

上一篇:get_post_statuses()

下一篇:get_post_taxonomies()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!