Instantly share code, notes, and snippets.
see the bp tricks snippet.
Thank you! Updated the snippet on BP-Tricks.com :-)
I believe this one is much better way:
even if multiblog enabled, the BP_ROOT_BLOG is always point to get_current_blog_id() so actually there's no need to check for that.