Answer the question
In order to leave comments, you need to log in
Wordpress woocommerce: how to allow viewing woocommerce settings and plugins not only for admin but also for other roles?
How can I allow viewing woocommerce settings and plugins not only for the admin but also for other roles?
For example, there is a plugin (some kind) and only users with manage_woocommerce rights can see it in the admin panel. That is, admins can see everything in the admin panel, and for example, users with lower rights cannot see the Woocommerce menu at all, only add-edit a product.
Which way to dig to allow such users to view this plugin? And whether it is necessary for such users to open the entire Woocommerce settings item or only the plugin can be added somewhere.
For example, I found the controller method in the plugin:
public function on_admin_menu() {
add_submenu_page('edit.php?post_type=wishlist', __('Notifications', 'wc_wishlist'), __('Notifications', 'wc_wishlist'), 'manage_woocommerce', 'wc-wishlist-admin-notifications', array($this, 'do_notifications_page'));
}
public function on_admin_menu() {
add_menu_page('Wishlist', 'Wishlist', 'manage_options', 'edit.php?post_type=wishlist', array($this, 'do_notifications_page') );
}
Answer the question
In order to leave comments, you need to log in
The direction seems to be correct.
Only 'manage_options' confused me, maybe there should be 'manage_woocommerce' ?
1. Install the User Role Editor plugin.
2; Come in, and having found the role you need, check off additional capabilities (Wookomers ones in this case).
3; Disable or even delete the plugin.
4. Profit!
PS: Despite the presence of the word user in the title, the plugin works with roles. You apparently read it as a User Role Editor, but it should be as a User Role Editor.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question