Support » Plugin: Content Control - User Access Restriction Plugin » restrict content for a specific a role(s)

  • Resolved Martijn



    With the shortcode you can show content specific to a role.
    What we would like is the opposite.
    We have a couple of different (custom)roles, on the same page we would like to show information relevant for the people with those roles.
    So we have a bit of shortcode for showing a bit of content for role A. (this works, no one else sees this but a person logged in with role A)
    Then have a second bit of shortcode do the same for role B.
    Then We would like a general text (basicly explaining how to get the other roles, what the benefits are etc.) to show to all other roles except those with role A or B.
    I know we can do this by manually adding all the roles that should have access, but that is not really future proof, we want to use this approach on multiple pages. If a new role is added in the future, they might not see what they are suppose to, as you then have to manually update all the shortcodes.
    Is this easy to do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author danieliser


    @ximie90 – I’m not sure what you are asking for exactly, I’m pretty sure shortcodes already support adding multiple roles via a comma.

    Really if you are worried about future proof you should probably not be using the shortcodes and should rather use the restriction editor which allows complex cases that cover many pages at once. Then if you need to update you do it in one place only.

    Yes, but this shortcode is to show content only to the selected roles.
    I want to hide it for selected role(s). => that would make it future proof.
    If a text is hidden for role A, then it doesn’t matter if I add a new role to the site, as role A will still be role A and they would then still not see the text that is hidden for role A.

    Plugin Author danieliser


    @ximie90 – will see what i can do in a future update about adding a allow/block option along side what roles you choose.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.