UPDATE: Download is now available from the WordPress.org Plug-In site. You can now download the plug-in at the WordPress.org site!.
Like many WordPress users, I often have the need to segment my content for different user audiences. While plugins like Post Levels and Disclose Secret are good ways of hiding entire posts from users that don’t meet a certain minimum user level, I couldn’t find a good plugin that did that for parts of a post. I did manage to find a few that would hide parts of a post from unregistered users, but not one that would give you control over which user levels could see that post.
To meet that need, I created the Show User Level Content plugin. This plugin is quite simple. If you want to make a certain part of your content accessible only to users of a specific user level, enclose them with the tag where <level> is the user level. End the section you want to hide with the tag .Sorry, you can't see this unless you are at User Level 2 or greater
will show the encapsulated content to users of level 2 or higher.
I based this plugin on another plugin that simply used the [hide] tag without the <level> modifier, but I can’t remember where I saw the code for that. If you wrote that plugin, let me know, so I can give you credit!
Simply copy the attached file to your /wp-content/plugins directory. Go to the Plugins configuration page in WordPress, and activate. That’s it.
If you want to customize what text users see when they are unable to view the privileged content, go to the Plugins administration page and you should see a page for “Show User Level Content Configuration”. Click on that link and you will be taken to a page where you can customize the “exception text”. This is the text that will replace the hidden text users can’t see.
Compatibility: I built this on and for WordPress 2.5.1. I’m not sure if it will work on older versions. I’ll try to keep it up to date for future versions.
Click here to download the Show User Level Content plug-in.
This is just a version 0.1 plugin! I’d love your feedback to help me make this better. If you know of a better plugin than this one to accomplish what I’m doing, please let me know ASAP so I don’t have to continue development
Contribute: Hey folks, I’m doing my best to keep my head above water and allocate my time to the most valuable tasks. Some of the other plugins in this area have died because no one cared enough to let the author know its value. The best way to let me know is to contribute to my Muse fund on the right side of this blog. Check out the Chip-In widget in the right sidebar, and please chip in. $5 goes a long way to help keep things running!