Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_displayed_user_id returning email?


  • Jesse Tayler
    Participant

    @jessetayler

    I tried to post this but it got lost?

    I’m trying to get the username like on this URL path

    https://marketerfaves.com/members/jesse-tayler/

    I tried a few functions, including

    bp_displayed_user_id

    but they always seem to return the user’s email address?

    is there another function I can call to get the username like “jesse-tayler” as used in the URL path there?

Viewing 4 replies - 1 through 4 (of 4 total)

  • shanebp
    Moderator

    @shanebp

    If you are on a profile page, try:

    $user_name = bp_core_get_username( bp_displayed_user_id() );


    Jesse Tayler
    Participant

    @jessetayler

    thank you!

    I am trying to adjust some code that works for another installation and do not really speak PHP, so I’m confused why this does not work?


    add_action( 'bimber_buddypress_memebers_after_user_name', 'bimber_buddypress_memebers_after_user_name' );
    $user_name = bp_core_get_username( bp_displayed_user_id() );
    function bimber_buddypress_memebers_after_user_name( $user_name ) {
    echo do_shortcode( '[truanon_verification userid='.$user_name.']' );
    }

    That code ALSO results in the email being used!

    What am I doing wrong here that I’m somehow stuffing the user’s email instead of this first-last pattern I see being used in the URL Path?


    shanebp
    Moderator

    @shanebp

    You need to talk to whoever wrote the bimber code.
    You need to look at the shortcode function for truanon_verification
    It could be that it is working and the shortcode returns the user’s email.


    Jesse Tayler
    Participant

    @jessetayler

    ok, thank you — the plugin is ours, but the site and bimber is not so I will check and see what I can learn.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar