默认情况下使您的帖子受到密码保护
我最初希望能够用密码保护一个类别。至少我希望它受到密码保护,但最好是用户名和密码登录。由于我几天来都没有成功找到解决方案,所以我现在求助于使用 WordPress 内置的帖子密码保护。
我遇到的问题是我将通过电子邮件发帖,为了使这些帖子受密码保护,我需要登录 Wordpress,然后手动选择受密码保护并在仪表板中输入密码。
我希望能够默认情况下使用相同的密码对特定类别中出现的所有帖子进行密码保护。无需登录 Wordpress 并手动选择密码保护。
我知道有一个函数 我需要使用它,但我不确定如何实现它或在哪里实现。
I originally wanted to be able to password protect a category. At the very least I wanted it to be password-protected, but preferably a username and password login. Since I have been unsuccessful for days at finding a solution I have now resorted to using WordPress's built-in password protection for posts.
The issue I am having is I will be posting via e-mail and in order to have these posts password-protected I need to login to Wordpress and then manually select password-protected and enter a password in the dashboard.
I would like to be able to have all posts that appear in a specific category be password-protected with the same password by default. Eliminating having to log in to Wordpress and manually select password protect.
I know there is a function <?php post_password_required( $post ); ?>
that I need to use but I am not sure how to implement it or where.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基于此 WordPress StackExchange 答案。仅使用常规仪表板进行测试。通过电子邮件发布必须经过测试,但我想在这种发布中会调用挂钩。
Based on this WordPress StackExchange answer. Tested only with a regular dashboard. Publishing via email has to be tested, but I suppose the hook gets called in this kind of posting.