Re: How to get userid regardless of context
Thanks for your help everyone!
OK, I think I have it working, however its not super desirable. I had to add 4 filters (and corresponding custom functions) in bp-custom.php and I also had to modify bp_core_get_user_displayname in bp-core.php. Adding a filter for it doesn’t do the trick because the passed in $user_id_or_username gets modified by the function the first time it is run in the core, and when using the filter $user_id_or_username actually contains the displayname, not the id or username.
so I now have the following entries in bp-custom.php:
// also had to modify bp_core_get_user_displayname in bp-core.php
It would be great if:
1. bp_core_get_user_displayname was used by all other functions that need a display name (currently I have to re-define the 4 additional functions above).
2. bp_core_get_user_displayname could be changed in the filter and not the core (as explained above).