admin管理员组文章数量:1426518
I’m working on a website which requires these two type of access for each post. (I mean, each post can be viewable in both of these cases)
1- Registered users in specific groups should be able to view the post.
2- Non-registered users should be able to view the post using a password.
I tested different plugins and settings to implement these scenarios but with no success. Any help?
I’m working on a website which requires these two type of access for each post. (I mean, each post can be viewable in both of these cases)
1- Registered users in specific groups should be able to view the post.
2- Non-registered users should be able to view the post using a password.
I tested different plugins and settings to implement these scenarios but with no success. Any help?
Share Improve this question asked Jun 7, 2019 at 14:14 SiaSia 11 bronze badge1 Answer
Reset to default 0Im really inexperienced with wordpress but i googled a few sec on google and maybe this will help.
function is_user_logged_in() {
$user = wp_get_current_user();
//Try to detect if the user is in a group here
return $user->exists();
}
Maybe you can try to do something with the page if the user is detected as user and in what group it is.
Source: https://developer.wordpress/reference/functions/is_user_logged_in/
本文标签: pluginsHow to make a page both “private” and “password protected”
版权声明:本文标题:plugins - How to make a page both “private” and “password protected” 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745427477a2658180.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论