admin管理员组文章数量:1319479
I noticed in the register_post_status
function in core that there is an arg for 'protected'.
The following post statuses: 'future', 'draft', and 'pending' all have this set to true.
I'm not talking about a protected 'post' but the 'protected' argument used when registering a custom post_status
.
What does this 'protected' status do? And why would I make a custom post status protected?
I noticed in the register_post_status
function in core that there is an arg for 'protected'.
The following post statuses: 'future', 'draft', and 'pending' all have this set to true.
I'm not talking about a protected 'post' but the 'protected' argument used when registering a custom post_status
.
What does this 'protected' status do? And why would I make a custom post status protected?
Share Improve this question edited Sep 18, 2013 at 20:52 jjeaton asked Sep 18, 2013 at 18:14 jjeatonjjeaton 2,2072 gold badges25 silver badges37 bronze badges2 Answers
Reset to default 14register_post_status
is used for creating a custom post status. The protected argument, if true, specifies that a user must be logged in and have edit permissions on the post to view (preview) it.
For example, you said that the "draft" post status has protected
set to true. This means that you can only view (preview) the draft post if you have permission to edit the post. Once the post is published, the protected
parameter is turned off and anyone can view it.
If you are creating your own custom status, you might want it to be protected. For example, you could have a post status called "on_hold", and when you set a post to that status, it would no longer be visible to the public, but still visible to the administrators of your site.
IIRC it's if a post is password protected.
本文标签: coreWhat is a quotprotectedquot post status
版权声明:本文标题:core - What is a "protected" post status? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742059403a2418488.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论