Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Can functions in bp_template_tags.php be applied to a specific user ID?


Boone Gorges
Keymaster

@boonebgorges

As Paul said, those functions are intended to be used in a theme template. More specifically: they’re meant to be used inside of a member/group/activity/etc loop. So if you’re inside of a member loop

functions like bp_member_name() will automatically detect which member is currently being processed. There’s no need for a $user_id argument.

Most of the bp_has_x functions take arguments for specific members. For instance, bp_has_members( ‘include=3,7,24’ ) will make a loop of just those three members. Inside of that loop you can use any of the templatetags functions.

See, for example, https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/

Skip to toolbar