• Resolved kidkilowatt

    (@kidkilowatt)


    After activating users, I have to assign them a specific user role. Currently, it’s a multi-step process where I activate the user and am redirected to the full list of users where I have to search for the newly activated user’s name and select and set their role.

    What would be super-duper nice is if we could select available roles for pending users on the activation screen OR after activating a user, I am redirected to that user’s profile to select and set their role.

    Are either of those options possible? Thanks for the wonderful work you’ve done with the plugin!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    I have to believe it would be possible in the long run, but it’s not something that our plugin here is set up to handle. We mostly just stick with some user meta and limit based on that value.

    Thread Starter kidkilowatt

    (@kidkilowatt)

    Ah, OK. Thanks Michael! Is there a section of code I can alter to change the redirect to wp-admin/users.php to something else after a user is approved?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Nothing like that present in our admin page where we’re marking them as approved, to be honest. Right now we just listen to the admin_init hook and check for $_POST values. Best way I can think of at the moment to potentially help you here would be to add a hook at the end of our callback that you could latch onto and redirect at that point. I’ll open an issue for the idea in general, but can’t promise a timeframe for release.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hello,

    I am also trying to set the user role when activating. Currently I have to “approve” in 2 places (once for BP Registration Options Menu, then once in “Manage Signups” menu option under “Users”). I also have to set the user roles for both bbpress and wordpress to be “participant” and “subscriber” respectively.

    1) Does this require custom code or is there a cleaner way to do approvals
    2) If it does require code, which files am I concerned with changing and what (generally speaking) do I add to them? I have a few friends who can help me with the code since I don’t know php.

    Thanks in advance for the help!

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Regarding any sort of role customization, you shouldn’t need to do anything in regards to our plugin. Like I said in my first reply in the thread, all we really do is attach a little bit of user meta to “flag” a user as pending or not, and redirect appropriately based on that user meta value. We don’t do any role manipulation/changing for them.

    Curious what you could do regarding your needs, with this hook: https://github.com/WebDevStudios/BuddyPress-Registration-Options/blob/4.3.1/includes/admin.php#L270-L277

    Thanks! Is there a place I can find code that deals with setting user roles? I’m not a developer but can piece this together if I have the functions/shortcodes or whatever.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I have nothing specific other than either the WordPress codex or Googled tutorials on the topic.

    Okay thanks Michael!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Set Role on Activation Page or Redirect to User’s Profile after Activation’ is closed to new replies.