Is there a way to only allow certain user ranks to comment on a post
Is there a way to only allow certain user ranks to comment on a post
Is there a way to only allow certain user ranks to comment on a post
Counting post and changing roles in mysql database. Query not code
While creating a post, can I restrict the authors in the dropdown list based on their user role?
Your use of the init hook means that the cap is set on every page load. A better approach is to write a small plugin and set the cap once by using the plugin activation hook. And remove it using the deactivation hook.
The ultimate member is truly magical, although it is a little difficult to comprehend. If you wish to prevent certain user role notifications, utilise the ultimate member hook from the link below. Ultimate Members Hooks https://docs.ultimatemember.com/article/1324-hooks-list?hook=um_email_notifications
Vistors usually always have the rights to access a post. Only exceptions that I know are drafts, password protected posts or post_types that are not public accessable. You could use get_post_status() and post_password_required()
Disabled delete_others_posts if post is from admin
How to assign a role to a simple visitor?
Edit and delete permissions pages and posts
User can’t search himself on rest api