Deprecated: Hook wpmem_inc_login_args is deprecated since version 3.3.0! Use wpmem_login_form_defaults instead. in /var/www/vhosts/rocketgeek.com/test.rocketgeek.com/wp/wp-includes/functions.php on line 6078
I have written code snippets before on how to restrict content by user level, but that particular code snippet is based on using categories as the user levels, with higher level users still being able to access lower level content. For example, Silver, Gold, and Platinum level users having access or not to categories of the same name.
But what if you have content that you need to block by level that is not necessarily in a category? Or what if you are using pages that need the same level of restriction.
Here is a code snippet that will allow you to assign a “level” to any content – post or page, and then assign a user level for the users. This example provides a working code snippet for applying a series of progressive levels (higher level users have access to lower level content). The example begins with three generically named levels, these can be renamed and expanded or contracted as needed.
To gain full access to WP-Members premium content, a current support subscription is required. You can purchase
an annual support subscription for as little as $59, which provides you with access to priority support, a
customer support forum, access to code snippets, and more.
Why wait? Choose your subscription option here.
[Why join?]