While the core plugin restricts posts to logged in users, and can also create memberships for other types of restriction, sometimes you may wish to restrict content to a user role.
This custom code snippet can be copy-pasted to wherever you store custom code and will add a list of roles to the WP-Members restriction meta box in the post editor, and then will restrict the content based on those roles.
Note that this functionality is included in the WP-Members Advanced Options extension.
Continue Reading →