Question
I have a custom plugin which allows users to follow each other. The follow and unfollow functionality works by ajax which is fine but there are just a few bugs that need sorting out which I am unsure as to ...
0
, , , 2 months 0 Answers 32 views

Question
I found this code here: What action should I hook into when adding roles and capabilities? add_action('after_setup_theme','my_add_role_function'); function my_add_role_function(){ $roles_set = get_option('my_roles_are_set'); if(!$roles_set){ add_role('user_one', 'User One', array( ...
0
, , 2 months 0 Answers 36 views

Question
I need to perform some cleanup after a user logged out, so I added a wp_logout action hook. Problem is, wp_get_current_user() already returns null if called from within the wp_logout action hook. How do I get the logging out users ...
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 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 33 views