## Where are available Roles Defined in the wp_ database?

Question
I got on the list to test a private beta of a plugin I'm using on a multisite network. The plugin authors have code in there to add a custom role. They have a bug that removes the ability to give ...
0
2 months 0 Answers 33 views

## Hiding div based on user role

Question
I am running the following snippet on my wordpress site to display an image. I would like to hide this div if the user role is "wholesale" (a custom role I created). Is this possible? add_action( 'woocommerce_review_order_after_submit', 'content_below_checkout_button' ); ...
0
2 months 0 Answers 26 views

## WooCommerce custom role not working

Question
I am trying to add WooCommerce product adding/editing capabilities to the Yoast SEO Manager role, however all it does is add the WooCommerce menu icon to that user role, and not the products tab, so that role cannot edit/create products. Here ...
0
2 months 0 Answers 34 views

Question
I am adding an action after user registration to add another user role based off the users meta_value. When I use: add_action('um_after_save_registration_details', 'custom_after_new_user_register', 10, 2); function custom_after_new_user_register($user_id) {$user = get_user_by('id', $user_id); if (!in_array('subscriber',$user->roles)) { $user->add_role(editor); ... 0 2 months 0 Answers 36 views ## Add User Role: Pre-saved in User-Meta Question I am adding an action after user registration to add another user role based off the users meta_value. When I use: add_action('um_after_save_registration_details', 'custom_after_new_user_register', 10, 2); function custom_after_new_user_register($user_id) { $user = get_user_by('id',$user_id); if (!in_array('subscriber', $user->roles)) {$user->add_role(editor); ...
0
2 months 0 Answers 32 views

## Updating wp_user_level on user update

Question
I have the following code, which properly adds the wp_user_level of 2 when a new user is registered with the role "division_manager". I need the wp_user_level to be non-zero so they can be the author of posts. add_action( 'user_register', 'set_user_default_division_manager', 10, ...
0
2 months 0 Answers 30 views

## How to manage roles and capabilities

Question
Roles and capabilities is easily the most confusing part of WordPress. Just when I think I have it sorted, I realise ...NO! I created a plugin and gave all the plugin admin pages in Dashboard: publish_pages capability. (Because I think this ...
0
2 months 0 Answers 24 views

## Is there way to rename user role name without plugin?

Question
Is there anyway to rename a user role name via hook, instead of using plugin? Edit For example, administrator » owner
0
2 months 0 Answers 37 views

## Allow users to change their role except for the roles I choose

Question
This function displays a check list and allows all users to edit their user role/s to any others in the backend user profile backend, including admin etc. How would I exclude certain roles from the list? function mrpu_plugin_init() { ...
0
2 months 0 Answers 32 views