Restrict content by User role Levels

Restrict Content by User Role Levels

This feature allows you to restrict/allow post/page/custom post type content based on user roles hierarchy without specifying each and every user role. For example: If you allow access to Subscriber user role, other user roles above Subscriber will automatically get access. You can also change the hierarchy of the user roles on your site. You can place your restricted content within the shortcode to limit the access.

Define User Role Hierarchy 

You can define the user role hierarchy by going to Private Content Settings -> User Role Hierarchy. You will get a screen similar to the following.

role-hierarchy

This will display the default WordPress user roles hierarchy.  You can customize it by dragging and dropping the user role items and saving the changes. If you need default hierarchy, just Save the changes without changing the order.

Allow Content for User Role Levels

This feature allows you to allow content for certain user role and user roles above the specified user role or user roles below the specified user role.  You can use allowed_roles attribute to define the user roles for allowing content. Let’s take a look at the usage of this attribute.

Allowing Content for One User Role and Higher Levels

Assuming that you have the default user role hierarchy, following shortcode will allow the content for Author,Editor, Administrator user roles.


[wppcp_private_content  allowed_roles="author-plus" ]
Private Content for Author User Role and Higher User Roles
[/wppcp_private_content]

Allowing Content for One User Role and Lower Levels

Assuming that you have the default user role hierarchy, following shortcode will allow the content for Author,Contributor, Subscriber user roles.


[wppcp_private_content  allowed_roles="author-minus" ]
Private Content for Author User Role and Lower User Roles
[/wppcp_private_content]

WP Private Content Pro

Extend Features of Free Version
Simple Setup
Advanced Restriction Rules
Membership & Private Page Management
Priority Support
VIEW MORE