[buddypress-trac] [BuddyPress] #4329: Changes in function bp_is_user() and bp_actions hook

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Jul 6 00:02:57 UTC 2012

#4329: Changes in function bp_is_user() and bp_actions hook
 Reporter:  imath         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  1.6-beta
 Severity:  normal        |   Keywords:
 Good evening,

 Since 1.6 beta 1, when i want to use bp_is_user() to check after using the
 hook bp_actions, it returns false even if i'm on displayed user.

 exemple :

 function my_function() {
     var_dump( bp_is_user() );
     // will return false even if i'm on the displayed user
 add_action('bp_actions', 'my_function');

 // But :

 function my_function_bis() {
         var_dump( bp_is_user());
         //will return true

 add_action('bp_head', 'my_function_bis');

 After some research it appears that when you use bp_actions hook and you
 are on all the member/user templates is_404 is true... And as bp_is_user
 return false if is_404 is true, then i cannot use it to check if i'm on a
 member/user template

 Exemple :

 function my_function_ter() {
         var_dump( is_404() );
         //wil return true if i'm on http://siteurl/members/imath
 (activity, profile, messages, ...)

 add_action('bp_actions', 'my_function_ter');

 So for my plugin i fixed my issue by using bp_displayed_user_id() instead,
 but i thought i should report this change of behavior.

 Good night.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4329>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list