holyredbeard
holyredbeard

Reputation: 21218

Show user (role) specific content

I'm working on a site which is going to be used by different schools my company that is working with. A school will have a specific user account and I want to be able to provide school specific content that will only be visible for the logged in school (pdf:s etc).

I've been looking around but haven't found a straightforward solution for this yet (is there even one?). So, what is the best way of doing this?

Upvotes: 0

Views: 213

Answers (1)

Pavel Petrov
Pavel Petrov

Reputation: 730

First of all you have to create a custom role with certain capabilities with the add_role() function and then show content based on the capabilities the current user has with the function current_user_can() you didn't mention if the content will be in the backend or frontend but the principle is the same.


Edit:

Also this plugin seems to cover what you need link

Upvotes: 1

Related Questions