Vladimir Garagulya
Forum Replies Created
-
Forum: Plugins
In reply to: [User Role Editor] Add user roles to Account pageClarify, about what account page do you write? Is it WordPress user profile page or WooCommerce account page?
If this page is built for WordPress using PHP, it would use an action/hook, which allows to insert to it the additional output from PHP code too.
Forum: Plugins
In reply to: [User Role Editor] Two Roles canceling each other out?You are right, roles are additive, in case software checks if user can capability, like current_user_can(‘edit_posts’). But if soft. check a single role only, like current_user_can(‘subscriber’) and ignores other roles granted to user, then you can meet a problem.
Try to change roles by places, 1st, as primary role, grant role from Events Calendar, then grant subscriber. Look if it will change something.
Forum: Plugins
In reply to: [User Role Editor] Add support for pluginI don’t have this plugin on hands to investigate it.
Many plugins use WordPress built-in capabilities, like ‘manage_options’ or ‘edit_posts’. You may search via plugin file to check what capability protects its admin menu, e.g.
grep -rn ‘add_menu’
Pay attention on the 3rd parameter value in the add_menu_page() function call.While WordPress API supports granting multiple user roles to the same user by design, user profile page has only single role field for Primary role. Thus if URE is deactivated ,user profile page does not contain data about other roles granted to user and any update posts to the server the data about primary role only. So URE on activation know nothing about older user roles data which was overwritten.
If you use multiple roles granting you have to leave URE active or prohibit users update their profiles.
Forum: Plugins
In reply to: [User Role Editor] Hide URE Dropdowns on Users List Page“Change role to” belongs to WordPress itself. You may revoke promote_users capability. It will hide “Change role to:”, but the “Role:” field at the user profile page too.
Forum: Plugins
In reply to: [User Role Editor] Hide URE Dropdowns on Users List PageTry this one:
/* * Hides "Grant Roles" button, "Add Role", "Revoke Role" URE UI controls at Users list page */ add_filter('ure_bulk_grant_roles', 'ure_bulk_grant_roles'); function ure_bulk_grant_roles( $show ) { $lib = URE_Lib::get_instance(); if ($lib->is_super_admin()) { // do not hide for superadmin return $show; } return false; }Forum: Plugins
In reply to: [User Role Editor] Disable the “Additional Capabilities” completelyAbility assign multiple user roles to a user is WordPress internal feature. URE just exposes it to WP UI. You can exclude related sections uses filters:
/* * Hides Additional Capabilities section at user profile * and other roles section at the "Add new user" page. */ add_filter('ure_show_additional_capabilities_section', 'ure_show_additional_capabilities_section'); function ure_show_additional_capabilities_section( $show ) { /* Remove comment if do not wish to apply this for administrators also $lib = URE_Lib::get_instance(); if ($lib->is_super_admin()) { return $show; } */ return false; } /* * Hides "Grant Roles" button at Users list page */ add_filter('ure_bulk_grant_roles', 'ure_bulk_grant_roles'); function ure_bulk_grant_roles( $show ) { /* Remove comment if do not wish wish to apply this for administrators also $lib = URE_Lib::get_instance(); if ($lib->is_super_admin()) { return $show; } */ return false; }Forum: Plugins
In reply to: [User Role Editor] User Roles change when editing profile/reset passwordI suppose that some plugin (may be membership plugin) revert roles granted to user according to its own logic. You may deactivate all plugins and test profile update activating plugins back one by one to isolate a source of this problem.
Yes, site admin has the option to block on site files editing (wp-includes/capabilities.php, #597):
case 'edit_files':
case 'edit_plugins':
case 'edit_themes':
// Disallow the file editors.
if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {
$caps[] = 'do_not_allow';
} elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) ) {
$caps[] = 'do_not_allow';
} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
$caps[] = 'do_not_allow';
} else {
$caps[] = $cap;
}‘edit_themes’ capability protects menu item: Themes -> Theme file editor,
which allows online editing theme files using WordPress internal file editor.Forum: Plugins
In reply to: [User Role Editor] Missing “Delete Role” Button / OptionLook if current user (administrator role?) can the ‘ure_delete_role’ capability from “Custom capabilities->User Role Editor” group.
Forum: Plugins
In reply to: [User Role Editor] Error at edit userOK. Thanks.
Can you show full call stack with this error message?
Forum: Plugins
In reply to: [User Role Editor] Not able to set permissions for specific custom post typeYes, it’s intended by design for some custom post types. Read this article:
https://www.role-editor.com/documentation/manage-access-to-custom-post-types/
Forum: Plugins
In reply to: [User Role Editor] Allow only access to Woocommerce AnalyticsHi,
Grant to a role only 2 WooCommerce capabilities:
view_admin_dashboard – general access to wp-admin
view_woocommerce_reports – access to “Analytics” menu items.Forum: Plugins
In reply to: [User Role Editor] Woocommerce settingsHi,
To work with shop orders do not grant ‘manage_woocommerce’ capability. It allows access to WC Settings, but is not needed for access to orders. Look for the role which is enough for this purpose:
https://www.role-editor.com/woocommerce-view-edit-orders/