Vladimir Garagulya
Forum Replies Created
-
Forum: Plugins
In reply to: [User Role Editor] unfiltered_html not working as expectedBy default WordPress multisite blocks ‘unfiltered_html’ capability even if it’s granted to a role:
case 'unfiltered_html' (wp-includes/capabilities.php, #421): // Disallow unfiltered_html for all users, even admins and super admins. if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) { $caps[] = 'do_not_allow'; } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'unfiltered_html'; }You can try this recipe, just replace ‘editor’ with your own role ID:
https://gist.github.com/jazzsequence/4f16932fdc5980c0af43dbdc9bf9aac4URE Pro includes similar solution managed as an option at the Settings page.
- This reply was modified 5 years, 1 month ago by Vladimir Garagulya.
Forum: Plugins
In reply to: [User Role Editor] Enable Editor to Manage WP Membership“Simple Membership” protects its admin menu items with ‘manage_options’ user capability.
Forum: Plugins
In reply to: [User Role Editor] Unable to change user capabilitiesIs it WordPress multisite with domain mapping?
Forum: Plugins
In reply to: [User Role Editor] BuddyBoss User Roles – Groups admin?Hi,
Quick search through the older copy (2019) shows that BuddyBoss uses ‘manage_options’ user capability when checks access to some critical options, the same way as BuddyPress itself does.
Forum: Plugins
In reply to: [User Role Editor] Hide global addon from shop manager roleHi,
Clarify what do you mean under “global addons”. Link to the screenshots will be helpful.
Forum: Plugins
In reply to: [User Role Editor] Product Feed Pro plugin compatibilityHi Marco,
Some plugins use WordPress built-in user capabilities like ‘manage_options’.
Some plugin may directly check if user has ‘administrator’ role. It’s difficult to say more without access to plugin source code.In general, you may search through PHP source code for ‘add_menu_page’, ‘add_submenu_page’ function call occurrences and look what user capabilities plugin uses for its admin menu items. Also it’s useful to look what capabilities plugin checks when uses ‘current_user_can’ function.
Forum: Plugins
In reply to: [User Role Editor] User roles on html tagHi,
No, it’s not possible with URE. It does not support access management for “custom html blocks” shown at the screenshot.
Forum: Plugins
In reply to: [User Role Editor] Allow Product Vendors to import CSV filesWhat plugin allows to import products from CSV file? Send the link if it’s available from wordpress.org
Forum: Plugins
In reply to: [User Role Editor] Dokan vendor specific roleYou can, but you have to know what filter to use for it, or modify some .php file from parent theme, responsible for orders output.
Forum: Plugins
In reply to: [User Role Editor] woo Product page editor not loadingI can not repeat this.
Do you use any plugin which replace WooCommerce default product editor page with a custom one?
Are there any error messages in server log files or at browser JavaScript console, which may give more information about what is going wrong?There is nothing wrong. By default ‘read’ capability is responsible for the access to admin backend (wp-admin). If your users should work with front-end only, you can revoke ‘read’ capability without problem (until you don’t use some plugin which may user this capability in its own purpose).
Forum: Plugins
In reply to: [User Role Editor] Editor Access Intermittent – Want to Rule Out UREHi,
It may be a known issue. WordPress makes some internal calculations on user permissions when user is granted a new role ($this->update_user_level_from_caps();):
/** * Add role to user. * * Updates the user's meta data option with capabilities and roles. * * @since 2.0.0 * * @param string $role Role name. */ public function add_role( $role ) { if ( empty( $role ) ) { return; } $this->caps[ $role ] = true; update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); /** * Fires immediately after the user has been given a new role. * * @since 4.3.0 * * @param int $user_id The user ID. * @param string $role The new role. */ do_action( 'add_user_role', $this->ID, $role ); }So if you change ‘editor’ role, you have to reassign it to users which has it making the steps you described.
You can use URE’s custom 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; }- This reply was modified 5 years, 2 months ago by Vladimir Garagulya.
- This reply was modified 5 years, 2 months ago by Vladimir Garagulya.
Forum: Plugins
In reply to: [User Role Editor] Dokan vendor specific roleHi,
If Dokan vendor order is a custom post type, it should have the author_id field, like any other post. So compare this field value with current user ID, like below
$current_user = wp_get_current_user(); if ( $order->author_id!==$current_user->ID ) { echo 'You can not see orders of other vendors';In code above I suppose that $order variable contains WP_Post object initialized by the dokan vendor order database record.
Forum: Plugins
In reply to: [User Role Editor] manage instagram feed optionHi
“IF Pro Personal” may use some other user capability, like WordPress internal ‘manage_options’, etc. Ask plugin support or look yourself at the plugin source code.
Keywords are ‘current_user_can(‘, ‘add_menu(‘, ‘add_submenu(‘. Look what user capabilities are used by this plugin in its source code using
grepor another text search utility.