in Tips and Tricks, WordPress

Restrict Any WordPress Post/Page for Any Specific User Role

Sometimes we need to restrict any specific wordpress post or page for any specific user role. For this there are lots of plugin. While replying to a facebook group post where someone asked something lightweight or no heavy plugin. So tried to write a simple one file plugin with hard coded page or post id and user role which can be used in theme. Here I am sharing the code if that helps other who is reading this article.