You can combine a few things to achieve this.
-
this theme component: CSS Classes for Current User's Groups
-
a little bit of custom CSS in your theme
-
this feature: Generic bbcode wrapper for theme components
So for example, if you have a group named foo
, the theme component (1) will add .group-foo
to the page for all members of the group.
Then add this custom CSS (2) to your theme:
body:not(.group-foo) {
[data-wrap="group-foo-only"] {
display: none;
}
}
Now you can use a generic bbcode wrapper (3) in a post’s content like this…
[wrap="group-foo-only"]
Only members of the group foo will see this content
[/wrap]
So the CSS will hide the wrapped content for anyone that’s not a member of the foo
group.
Note that this isn’t an entirely secure method to do this, savvy users could use their browser tools or safe mode to see this content if they knew what to look for.
If you need a secure method to hide content, you’d need to utilize a feature like whisper posts for staff (Create a Whisper post) or develop a custom plugin.