要向用户显示“挂起”帖子,可以添加“post\\u status”参数get_post()
或wp_query
功能类似
post\\u状态(字符串/数组)-使用post状态。按帖子状态检索帖子。默认值为“publish”,但如果用户登录,则会添加“private”。如果查询在管理上下文(管理区域或AJAX调用)中运行,那么也会添加受保护的状态。默认情况下,受保护的状态为“未来”、“草稿”和“待定”。
\'publish\' - a published post or page.
\'pending\' - post is pending review.
\'draft\' - a post in draft status.
\'auto-draft\' - a newly created post, with no content.
\'future\' - a post to publish in the future.
\'private\' - not visible to users who are not logged in.
\'inherit\' - a revision. see get_children.
\'trash\' - post is in trashbin (available with Version 2.9).
\'any\' - retrieves any status except those from post types with \'exclude_from_search\' set to true.
或者您可以查看wordpress codex以获取其他帮助。