Shortcode for content view access restriction

Shortcode for posts/pages content view access restriction is available at User Role Editor Pro starting from version 4.7. Enclose restricted content with these shortcodes:
1) [user_role_editor roles="role1, role2"] some restricted content [/user_role_editor];
2) [user_role_editor except_roles="role1, role2"] some restricted content [/user_role_editor];
3) [user_role_editor users="user_id1, user_login1"] some restricted content [/user_role_editor];
4) [user_role_editor except_users="user_id1, user_login1"] some restricted content [/user_role_editor]
and you will restrict access to the part or the whole content of any post or page.

roles attribute: 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. 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 [user_role_editor roles="none"].

If you use a comma ‘,’ sign as a separator inside roles list: “role1, role2”, then ‘OR’ rule is applied: users with role1 OR role2.

If you use a ‘&&’ signs as a separator inside roles list: “role1 && role2”, then ‘AND’ rule is applied: user with role1 AND role2 simultaneously.

except_roles attribute: 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[/user_role_editor].
‘none’ is a virtual role ID used by URE for not logged-in users

users attribute: To show content inside shortcode to logged in users with user ID or login inside comma separated list you can use this shortcode:
[user_role_editor users="18, 23, willy"]some restricted content[/user_role_editor]

except_users attribute: To show content inside shortcode to all users except users with user ID or login inside comma separated list you can use this shortcode:
[user_role_editor except_users="17, 25, peggy"]some restricted content[/user_role_editor]

In order to take into account not logged-in visitor you can use ID=0, like:
[user_role_editor except_users="0, 23, willy"]some restricted content[/user_role_editor]. This shortcode will show content inside to all logged-in users except user with ID=23 and user with login ‘willy’.

Other shortcodes enclosed inside User Role Editor shortcode are processed recursively.

User Role Editor version 4.7

User Role Editor version 4.7 was published at November 4th, 2013 in both (Free and Pro) editions. The changes applied to this version are:

  • “Delete Role” menu has “Delete All Unused Roles” menu item now. “Unused” means that role is not assigned to any user in this context. Using this option you may cleanup your blog from unused roles with one command.
  • More detailed warning was added before fulfill “Reset” roles command in order to reduce accident use of this critical operation.
    Once more – “Reset” deletes all current roles and executes WordPress core routine to re-create the standard WordPress roles only as they were just after fresh WordPress installation. Use this feature with care in order do not use later the recommendations from the warning message.
  • Bug was fixed at Ure_Lib::reset_user_roles() method. Method did not work correctly for the rest sites of the network except the main blog.
  • Pro version: Post/Pages editing restriction could be setup for the user by one of two modes: ‘Allow’ or ‘Prohibit’.
  • Pro version: Shortcode [user_role_editor roles=”role1, role2, …”]bla-bla[/user_role_editor] for posts and pages was added.
  • You may restrict access to content inside this shortcode tags this way to the users only who have one of the roles noted at the “roles” attribute.

  • Pro version: If license key was installed it is shown as asterisks at the input field.
  • Pro version: In case site domain change you should input license key at the Settings page again.

User Role Editor Pro 4.6.0.2 bug fix

User Role Editor Pro version 4.6.0.2 is available for downloads and update. This update concerns the roles import functionality and includes:

  • Bug fix: Invalid notice “Unknown error: Roles import was failed” was shown after successful roles import to the single WordPress site.
  • Update: Spaces in user capability are allowed for import to provide compatibility with other plugins, which use spaces in user capabilities, e.g. NextGen Gallery’s “NextGEN Change options”, etc.

General restriction for usage of spaces inside user role capability ID is left untouched in the User Role Editor. Less strict checking is allowed only for the import operation.

User Role Editor Pro 4.6.0.1 bug fix

October 26th, 2013 User Role Editor Pro version 4.6.0.1 was published. It is the bug fix release. No any new functionality was added.
Fatal PHP error occurred if user tried to view Gravity Forms entries or WooCommerce coupons, after turning on the “Activate user access management to editing selected posts and pages” option.
Please update from version 4.6, if you met similar problem.

Allow user to edit selected posts and pages only

You can allow user to edit the selected set of posts or pages or custom post types only. When it could be useful? Suppose you need to give the user ability to edit someone other’s post. But if you simply give that user “edit_others_posts” capability, such user will can edit any posts created by other authors. In this situation “User Role Editor Pro” may help you. Just restrict user access for editing selected posts and pages only. Read more Allow user to edit selected posts and pages only