Opened 9 years ago
Closed 9 years ago
#7221 closed enhancement (fixed)
Consider executing "friends_action_add_friend" not during WP`s init()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Friends | Keywords: | has-patch |
Cc: | info@… |
Description
friends_action_add_friend() is running in bp_init(). So this function sends the corresponding email and redirects the visitor while we are in WP's init().
If domain specific customizing is hooked into bp_init/init too (e.g. customizing the from adresse for emails via bp_email_get_from or wp_mail_from_name), you have to know the priority / load order to ensure the filters are running.
I think sending emails and redirecting in WP`s init is a bit too early. Wouldn't something like "wp_loaded" be a safer place, to ensure all filters added to bp_init/init are finished?
Good catch, wpdennis!
Looks like some old code. We should probably use the
'bp_actions'
hook instead of'bp_init'
.