Reply To: Global $bp does not contain current_user data
I believe I found a way to populate the displayed_user data in the $bp object, but the second I do I am redirected to the user’s profile page. Here is my hook:
add_filter('bp_displayed_user_id', array( $this, 'bp_displayed_outside_bp') );
function bp_displayed_outside_bp($id){
return ($id==0) ? get_current_user_id() : $id;
}
As expected, my dashboard page comes back with $id==0 and then the current user id is used to populate the displayed user data, but instead of then rending my dashboard page that I was on, I’m redirected to the profile page.
I’ve also removed all redirect hooks that I had to make sure none of them are interfering with this. I’m literally stuck right now hoping for some help/direction. So please let me know if you have any thoughts.