How to unpublish or 'hide' posts when author's user role changes?
-
I’m working on a website that assigns different roles to different users. Users of role “A” are allowed to publish content of type “A”. If a user changes to role “B” he/she is not longer allowed to publish content of type “A”.
Now I would want to find a way to ‘unpublished’ or ‘hide’ whatever that user has published while he/she was still assigned the user role “A”. Currently I can think of the following two possible approaches:
All posts are still published, but only the user and admins can see it.
All posts are unpublished when the user role changes.
To me approach 1 sounds more practical – so in case the user switches back to role “A” everything would instantly be visible again.I had a look at various plugins such as Members and User Role Editor but none seems to have that type of functionality – or am I missing something completely? Any pointers would be appreciated. Thank you!
- The topic ‘How to unpublish or 'hide' posts when author's user role changes?’ is closed to new replies.