Shortcode for posts/pages content view access restriction is available at User Role Editor Pro starting from version 4.7. Enclose restricted content with this shortcode
[user_role_editor roles="role1, role2"] some restricted content
[/user_role_editor] and you will restrict access to the part or the whole content of any post or page.
After that restricted content will be available for the logged-in user with one of the roles you input for the
roles attribute of the
[user_role_editor] enclosing tag. Pay attention that You should input the role identificator, not the role name. For example, valid shortcode will be
[user_role_editor roles="contributor"], not
[user_role_editor roles="Contributor"]. Pay attention to the lowercase 1st letter at “contributor”.
For all other users including the guest visitors restricted content, enclosed by the shortcode described above, will be hidden.
If you wish to show some content for not logged in (guest) visitors only, use this shortcode
To show content inside shortcode to all logged in users except users with selected roles, included them into the ‘except_roles’ attribute. For example, if you don’t wish to show some text to the ‘subscriber’ role and other not logged in visitors use this shortcode:
[user_role_editor except_roles="subscriber, none"]some text to hide from subscribers
‘none’ is a virtual role ID used by URE for not logged-in users
Starting from version 4.8 other shortcodes enclosed inside User Role Editor shortcode are processed recursively.