Hide Specific Divs from specific user role groups (2 posts)

  1. andrewrowland.g
    Posted 2 years ago #

    What is the most secure way to hide specific divs from everyone besides a specific user role group?

  2. bcworkz
    Posted 2 years ago #

    Simply wrapping the div output in a if(current_user_can('unique_capability')) block should be secure enough if the server is properly configured. Where 'unique_capability' is a capability assigned only to the specific role that is allowed to see the content.

    AFAIK there is no way for anyone to see this content unless they are a properly logged in user with that assigned role.

Topic Closed

This topic has been closed to new replies.

About this Topic