在 WordPress 中,如何确保用户只能看到自己的帖子?
我在我的博客中添加了一些自定义角色。它们工作正常并且功能正如我所指定的那样。问题是每个用户的帖子窗口中都有一个“所有”帖子的列表。他只能编辑自己的帖子,但可以看到其他用户撰写的帖子。
如何向角色添加限制(或任何不同的方式)以确保用户只能看到自己的帖子?
I have added a few custom roles to my blog. They work fine and the capabilities are as I have specified. The thing is that every user has a list of 'all' the posts in his posts window. He can only edit his own posts but does see posts written by other users.
How can I add a restriction to the role (or any different way) to make sure a user only sees his own posts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将其粘贴到您的functions.php 文件中。任何地方,可能在远离其他功能的底部。这应该限制用户看到不属于他们的帖子。
我希望这对你有用! :)
Try pasting this into your functions.php file. Anywhere, likely at the bottom away from other functions. This should restrict user's from seeing posts that don't belong to them.
I hope this works for you! :)