• Hey,

    I’ve been working around with some plugin code and was going to add another “feature” that awarded something based on the role and was wondering what hook I would use for this. You can see that the two below are the hooks from BP, but I am not sure which I would use to find all users in a certain role
    “Snippet” of the code

Viewing 5 replies - 1 through 5 (of 5 total)
  • Do you mean you want to award a badge when someone’s role changes; or you want to award a badge to everyone with a particular role?

    For the former, set_user_role perhaps. For the latter, it’d depend on the UI you want, I think.

    Maybe I’m mis-reading you though. 🙂

    Thread Starter Georgeba

    (@georgeba)

    Let me change the question, as I realized the problem wasn’t that. Here is part of my code:

    $this->community_triggers = array(
    __( ‘Profile/Independent Actions’, ‘badgeos-community’ ) => array(
    ‘Role #1’,
    ‘Role #2’,
    ‘Role #3’,
    ‘e.g’,
    ),

    I was trying to make it so that in the array, it would be a “dropdown” of the roles on the site in which the users can select one.

    Thread Starter Georgeba

    (@georgeba)

    Also, I don’t have the..

    ‘Role #1’,
    ‘Role #2’,
    ‘Role #3’,
    ‘e.g’,

    in the real piece of code, I was just “demonstrating” on what I was thinking

    Thread Starter Georgeba

    (@georgeba)

    p.s. they’re action hooks.
    Here’s an example of a buddypress one I found

    'bp_activity_posted_update'        => __( 'Blah Blah Blah', 'buddypress-extension' ),

    Thread Starter Georgeba

    (@georgeba)

    Would I use like get_editable_roles but if so, how?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hooks & Roles’ is closed to new replies.