I would like to load some code before the template begins printing in BuddyPress. What filter or action hook should I use?
I tried a number of them (such as
bp_init), but none of them seem to work. My code is simply never loaded.
The list of filters and action hooks is hundreds of entries long, which is a bit overwhelming to me, since I am fairly new to BuddyPress. So any help would be greatly appreciated.
I am trying to tell BuddyPress to use a different template if certain conditions are met. So I have some code in bp-custom.php and I would need the appropriate filter or action hook to get it working. Preferably one that accepts a
$template variable as an argument.
EDIT: I've tried with different action priority numbers (or without) and nothing seems to work. Still need help with this!