BuddyPress: BBP_BuddyPress_Activity::register_activity_actions() not running early enough
|Reported by:||r-a-y||Owned by:|
|Component:||Extend - BuddyPress||Keywords:||has-patch|
BuddyPress 1.6 introduced the "Activity" dashboard to edit activity stream items.
When editing a bbPress forum activity item, the activity type changes from 'bbp_reply_create' / 'bbp_topic_create' to something else.
This creates this problem:
bbPress is not registering its activity actions early enough.
The BBP_BuddyPress_Activity class runs on bp_init at priority 10:
While in that same class, it tries to register its activity actions:
The 'bp_register_activity_actions' hook runs at bp_init at priority 8 so it's a chicken-before-egg scenario.
Move the setup_components() hook to run at priority 7:
// Setup the components add_action( 'bp_init', array( $this, 'setup_components' ), 7 );
In the attached patch, I've also registered some additional activity actions for the groups component.
Not sure what the consequences are with moving the hook a little earlier, but this was the easiest fix I could find.