Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4385 closed enhancement (no action required)

Add hook into Add New Member Process

Reported by: frank13 Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.6
Component: Members Keywords:
Cc:

Description

I use a WordPress hook for the Add New User process via add_action('user_register', 'doMyFunction');

I would like to be able to also hook into BuddyPress' Add New User process.

Please consider offering an add_action('bp_user_register', 'letMeDoMyFunction') hook for this.

Thank you for considering.

Change History (12)

#1 @r-a-y
7 years ago

  • Component changed from Core to Members
  • Resolution set to invalid
  • Status changed from new to closed

Hi,

The hook you're looking for is 'bp_core_signup_user':
http://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-members/bp-members-signup.php#L443

Just to let you know that Trac is a place for reporting bugs about the software and not for support-related questions.

The support forum can be found here:
http://buddypress.org/support/

Thanks for using BuddyPress!

#2 @frank13
7 years ago

@r-a-y

Just for clarification, Trac is solely for bugs?

Is there a site we can use to request enhancements?

#3 @r-a-y
7 years ago

Trac is also for enhancements, but in this case, it was more of a support-related question.

Trac should be used when you've exhausted all possible means to find a solution like the support forum, the codex or directly looking through the codebase.

I should note that this is just my interpretation of Trac!

If you have any other Qs though, let me know!

#4 @frank13
7 years ago

I'll add codex and codebase to my resource list.

Currently, I use buddypress.org, wordpress.org, and wordpress.stackexchange.com.

After more than a day of no responses on any of the 3 forums, I assumed that there was no hook. So I came here thinking it should be an enhancement request.

#5 @frank13
7 years ago

Ok @r-a-y:

Not trying to hold a threaded dialogue here in Trac, but I am trying to understand how to use codex and codebase.

When I went to http://buddypress.org/ and entered "mystery man" in the search box, I got a number of blog posts as the result. That's odd behavior.

Then I went to your codebase link http://buddypress.trac.wordpress.org/browser/tags/1.5.6 and entered "mystery man" in the search box. I got Trac bug and enhancement reports.

Am I using these to resources correctly?

#6 @r-a-y
7 years ago

No problem, frank13!

The codex is updated by volunteers so the information you're searching for might not be readily available. Sometimes using Google might be an even better option to find what you're looking for.

About the codebase, the link I gave does not search through the code (my bad!). That's more of a general link to look through the code.

If you're comfortable looking through code, I would recommend developing locally so you can use your editor or your operating system's search functionality to find the snippet of code you're after. In your example, searching for "mystery man" within the /wp-content/plugins/buddypress/ directory might not yield any results, but searching for "gravatar" or "avatar" will.

Hope that helps in clarifying things! If not, let me know!

Last edited 7 years ago by r-a-y (previous) (diff)

#7 @frank13
7 years ago

@r-a-y, well I guess I failed to mention that I start all my research with Google. Then I move on to the 3 wp/bp forums.

I'm a developer mainly on the LAMP platform so I am very comfortable looking through code.

But I still getting my mind around WordPress Hooks. So, as I see it, looking at code wouldn't necessarily give me the add_action() or filter() I should be using. At least I don't think that a code search would render that.

Time will tell.

#8 @r-a-y
7 years ago

Good to hear that you're a developer, frank13! Can always use more! :)

But I still getting my mind around WordPress Hooks. So, as I see it, looking at code wouldn't necessarily give me the add_action() or filter() I should be using. At least I don't think that a code search would render that.

If you're having a hard time finding the hooks, sometimes it helps to use more general search terms and then you can narrow your search down.

Here's another resource that could help. etivite has a BuddyPress hook reference guide available here:
http://etivite.com/api-hooks/

It might be slightly outdated, but he has a search function as well that might help.

#9 @frank13
7 years ago

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...

#10 @r-a-y
7 years ago

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.

You might want to try the 'bp_core_activated_user' hook instead. When a user activates their account, this hook fires afterwards.

Without knowing what you're trying to, it's hard to debug your situation.

What does your rebuildAuthUsers() function look like?

If you have a forum support thread, please link to that and we can continue that discussion there instead of in Trac.

#11 @frank13
7 years ago

@r-a-y

What does your rebuildAuthUsers() function look like?: it writes the username to a flat text file and sends a welcome email. It works perfectly with the WordPress add_action('user_register', 'rebuildShibbolethUsers'); I am just trying to eliminate having to 1st create the user in WordPress and then add them in BuddyPress

When a user activates their account, this hook fires afterwards. The problem with this would be that I am not waiting for the user to activate their account. I am creating their account for them and sending them a welcome email.

Hoping you can help me out here:
http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-hook-into-add-new-member-in-buddypress/

or here:
http://wordpress.stackexchange.com/questions/59649/how-to-hook-into-add-new-member-in-buddypress

Most grateful...been at this for days.

Last edited 7 years ago by frank13 (previous) (diff)

#12 @DJPaul
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.