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

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

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

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