In the past, I have put up posts about restricting content to a created user “level,” restricting content to a specific user, etc. Interestingly, we have not yet touched on the subject of restricting content by user role.
The method used here is very similar to what was done to restrict a post or a page to a specific user. In fact, that code was my starting point – it really took some minor changes. So I’ll primarily focus on what is different.