Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/brashrebel/restrict-by-role/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Description
This plugin is very simple. It allows content creators to wrap pieces of content in a special shortcode and specify in that shortcode which user roles have read access to that content.
Installation
- Upload to
wp-content/plugins - Activate via the Plugins menu
- Create some awesome content within any post type
- Place a
[rbr role="X" message="Your message"]before the content you wish to restrict, replacingXwith Subscriber, Contributor, Author, Editor or Administrator and replacingYour messagewith what you would like people to see if they are not allowed to view the content - Place a
[/rbr]shortcode at the end of the content you wish to restrict
Notes
You can also use an additional parameter in the shortcode if you need to get way more specific about user roles that can access the content. The parameter is privilege and it accepts values from WordPress' Roles and Capabilities. Just figure out the values you need and enter those in the privilege parameter in the shortcode and don't specify a role.
EXAMPLE
`[rbr role="edit_posts"]`Changelog
0.1
- Initial release.