how to show user id instead of user name (or username)

  • Participant
    Level: Initiated
    Posts: 2
    anisur rahman on #39899

    before asking for help I want to appreciate this forum . I think this is the most helpful forum for buddypress. special thanks to Brajesh Singh.

    for privacy reasons, I need only admin to be able to see the user name. everyone else will see the user id. for example: User ID: 8564

    This will be everywhere (Members Page and individual profile page and profile link/URL is a must for my website).

  • Keymaster
    (BuddyDev Team)
    Posts: 22574
    Brajesh Singh on #39919

    Hi Anisur,
    Thank you for the kind words.

    This is an interesting but complex issue. There are multiple reasons for that.

    1. In case of BuddyPress/WordPress, there no single definitive way for displaying the name(some places display name, some places nick name etc are used).

    Filtering the part in url is complex one. BuddyPress uses the following function ‘bp_core_get_userid_from_nicename’ for preparing the current displayed user id. If we filter it, there might be side effects.

    To be honest, It is doable but is beyond the scope of what we can offer here as it will need too many filters(url, parsing ids) and can still have side effects.

    If you need hiding the display name(not the url), we can provide that for activity, members directory and user profile display name.


  • Participant
    Level: Initiated
    Posts: 2
    anisur rahman on #39941
    This reply has been marked as private.

You must be logged in to reply to this topic.

This topic is: not resolved