Hi there, I have been looking at the available BP action hooks, and I wonder, why there are no differentiation and options in the hooks directory between own profile and other users profiles?
An example is the hook
bp_after_profile_content
which displays on all profiles. I’m inserting the hook in an block element with no options for adding extra code for own profile.Is it possible to add something to the existing hooks, for specifying own or other users profiles?
Regards
CarstenHi Carsten,
The hooks will remain same.
You can use a function likeif ( bp_is_my_profile() ) { // my profile. } else { // not my profile. }
For hooks which only run on profile.
If you want to hook to a general action which may run on other pages and you want to do something for own profile/other profile.
You can do it like this
if ( bp_is_my_profile() ) { // my profile. } elseif ( bp_is_user() ) { // not my profile. but is guaranteed to be another user's }
Hope that helps.
Regards
Brajesh
You must be logged in to reply to this topic.