bp_displayed_user_id() – BuddyPress Function Reference

Description

Get the USER_ID of the currently displayed user. This buddypress function returns user_ID of profile page which is being visited. This also means that you can simply know if you are on a profile page by checking if the bp_displayed_user_id() function is not empty.

bp_displayed_user_id()

Parameters

None.

 

Returns

(INT) The currently displayed profile’s user_ID. Otherwise 0

 

Additional Remarks

This function can also be used to determine, if you are currently on profile page or not. So if you are not on profile page , 0(int) will be returned by the function.