[buddypress-trac] [BuddyPress Trac] #7221: Consider executing "friends_action_add_friend" not during WP`s init()
buddypress-trac
noreply at wordpress.org
Sat Aug 13 19:15:29 UTC 2016
#7221: Consider executing "friends_action_add_friend" not during WP`s init()
-------------------------+-----------------------------
Reporter: wpdennis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Friends | Version:
Severity: normal | Keywords: dev-feedback
-------------------------+-----------------------------
[https://buddypress.trac.wordpress.org/browser/tags/2.6.2/src/bp-friends
/bp-friends-actions.php#L22 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?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7221>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list