Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to hook into Add New Member in BuddyPress [Unresolved]

  • I have a hook into the WordPress Add New User process via an `add_action(‘user_register’, ‘doMyFunction’);` hook.

    What results is that I am (Step 1) adding a new user through WordPress and then (Step 2) having to add the same user to BuddyPress in order to get the user fully activated in WP/BP with the proper role.

    I would prefer to just add a new user/member once through the Buddy Press Add User page and have it go through my hooked function.

    Is there a Buddypress hook I should change too on the hook I show above in order to eliminate the 1st step described in my process?

    Thanks for helping.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Mainly to help anyone that looks here and tries to take away that `bp_core_signup_user` is the solution…well, it isn’t.

    In my plugin I simply replaced:
    `add_action(‘user_register’, ‘rebuildAuthUsers’); // rebuild the authorized user list anytime a new user is created through WordPress`

    with:
    `add_action(‘bp_core_signup_user’, ‘rebuildAuthUsers’); // rebuild the authorized user list anytime a new user is created through BuddyPress`

    It did not intercept the registration process and launch my function.

    Still digging…

    With some assistance from @r-a-y:
    The bp_core_signup_user hook does something after BP has registered the user. Registering the user does not mean the user is activated yet.

    I ran a test:
    `function myTest() {
    echo ‘fingers are crossed’; exit;
    }
    add_action(‘bp_core_signup_user’, ‘myTest’);`

    I created a new user in the BuddyPress Add New User form. I checked the box to not send an email.

    Results:
    (1) add_action() interceptor did not echo and halt — not what I desired
    (2) new user got an email — also, not what I desired

    Any suggestions @r-a-y or other BP Guru’s? Thanks

    I have some screen shots over here –> http://wordpress.stackexchange.com/questions/59649/how-to-hook-into-add-new-member-in-buddypress/59937#59937

    They might help trigger something you have done or seen in your BP implementation process…

    Thanks !!!


    r-a-y
    Keymaster

    @r-a-y

    @frank13 – I’m just re-reading this entire thread.

    It looks like you’re registering users manually via the WP admin dashboard’s Users page, but then are wondering why these users do not show up in BP’s Members Directory.

    When you register a user that way, they will not show up in BuddyPress’ members directory until they login.

    You can bypass this programatically by adding a ‘last_activity’ user meta entry.

    Read this thread for more details:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/make-all-members-active-1/#post-110469

    This hopefully addresses your problems!

    Ughh…excuse my frustration.

    Scope and Objective: to enable the Admin (me) to create user accounts. To capture the username created and pro grammatically write to an external file in order to allow user to authenticate though our private authentication method. And to enable new user to receive a welcome email at time they get setup.

    I do not care anything about when/how/why/or where they login or activate themselves so as to appear in BuddyPress. That is all down stream stuff that has nothing to do with my process.

    The only effective hook I have found is the `add_action(‘user_register’, ”);` Works like a charm.

    However, in order to get the user to be seen by BuddyPress I need to go through step #2 and Add New User in the Buddypress Admin page. That is where I tell WP/BP they are allowed access to the “site” and it is also where they get their role assigned.

    I have over 200 users to setup in the next week. If I could just cut down my process time by 50% — that is to eliminate the 2 step process and make it a 1 step process — I would be a little happier.

    I need to get the Buddypress equivalent hook to WP’s `add_action(‘user_register’, ”);`

    That is why I am asking for an enhancement to BP to get an equivalent hook. Down the road it will make my setup life easier.


    r-a-y
    Keymaster

    @r-a-y

    BuddyPress does not come with an “Add New User” admin page. You are probably referring to WordPress’ User admin page.

    I just took a look at your StackExchange thread and it appears you’re using WordPress Multisite:

    This is very important to know because you’ll need to run your script on the site that has BuddyPress installed.

    Because of using WP Multisite, you’ll also have to change your hook to ‘wpmu_signup_user_notification‘.

    The BuddyPress signup hooks I mention above only take effect on frontend registration (eg. testbp.org/register). Since you’re not using frontend registration, those hooks won’t work for you.

    Is there any reason why you need multisite?

    That will probably give you enough to go on.

    per @r-a-y: “Is there any reason why you need multisite?”

    It is my understanding that as of WordPress 3.0 MU was automatically built into core. I am not using multisite, per se, that I know if. At least I did not intent to use it. I do know that I have 2 dashboards in my WordPress under My Sites:
    (1) Network Admin
    (2) my Buddy Press site

    It does get a little hairy lopping through both dashboards to make settings tweaks and activate and deactivate plug-ins, etc.

    I will certainly give ‘wpmu_signup_user_notification‘ a try…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to hook into Add New Member in BuddyPress [Unresolved]’ is closed to new replies.
Skip to toolbar