Skip to:
Content
Pages
Categories
Search
Top
Bottom

admin add members from WP Users list


  • mophilly
    Participant

    @mophilly

    I have a project that includes membership in a specific BP group upon payment of a subscription. This requires that the site admin be able to add a validated member without the user log in.

    An BP specific email asking for confirmation is not required as it is covered in the subscription agreement and the attendent email. An extra step has been criticized by some customers as an unnecessary complication. An email advising of the new membership is sent to the end user. Users can opt out of the agreement at any time.

    The “how to” at https://codex.buddypress.org/developer/user-submitted-guides/how-to-add-members-to-a-group-via-wp-users-screen/ looks like the right idea. It does not, however, result in additions to the group membership.

    I considered hacking the database via brutish approach, but that is not a good approach. Is there a code snippet or plugin that enables adding members to a group by the site admin?

    I am using BP 7.2.1 and WP 5.7.

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

  • shanebp
    Moderator

    @shanebp

    > This requires that the site admin be able to add a validated member without the user log in.

    So they can make the payment without signing up as a WordPress user on your site?
    If they don’t have a login name, then they don’t have an ID and cannot be added to a group – by any method.

    If they do have a WP login name, then you can add them in wp-admin.
    Go to Groups, mouse-over a Group Name and click Edit.
    On the Edit screen you will see this section: Add New Members.


    mophilly
    Participant

    @mophilly

    Thank you for the reply. I apologize. I wasn’t clear.

    A new WP user account is created when the customer signs up and pays via another system. The sales team creates the new WP user account and sends a welcome letter with a lot of info.

    At this point, we need to add the new user to the BP group. That way the new customer can enjoy all of the resources on the site, including the group membership.

    Also, while we can add new members as you describe, they do not appear in the BP group until the new customer logs on. This means they miss other communication disseminated via the BP group.

    What I am seeking is a method, a plugin or code snippet for our custom code, to handle this without extra steps on part of our staff and our users.


    shanebp
    Moderator

    @shanebp

    Use these functions in your custom code after the user is added and their ID exists:
    Add user to a group: groups_join_group( $group_id, $user_id );
    Make user active on the site: bp_update_user_last_activity( $user_id );


    mophilly
    Participant

    @mophilly

    Great! Thank you.
    I will add those bits to our code base and see how far we get.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar