Skip to:
Content
Pages
Categories
Search
Top
Bottom

Getting bp user info


  • maxlinux2000
    Participant

    @maxlinux2000

    Hi all,

    I’m new here. a big hello to the community!!

    I’m tring to hacking an external WP plugin in order to works with buddypress.
    The Plugin is WP Mobile Menu

    My idea is to add some buttons in the header to this plugin, in order to make easy for the user open some useful page, like Activity, Profile an so on.

    Actually Is working just fine, with this code:

    $current_user = wp_get_current_user();
    // Profile
    $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/';
    $output .= $current_user->user_login;
    $output .=   '\'"></div>';

    …but…but… if the username contain a dot character, buddypress transform the dot in ‘-‘ so pressing the button above, the user obtain a 404 page… and some users of mine, are using a email address as username.

    So I’m trying to modify my code so, but it doesn’t work at all.

    global $bp;
    $userlink = get_bp_loggedinuser_link();
    // Profile
    $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/';
    $output .= $userlink->user_login;
    $output .=   '\'"></div>';
    

    Someone know ho to import the bp_loggedinuser_link() variable in a external WP plugin?
    (it’s not a 3th part buddypress plugin)

    regards
    MaX

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

  • shanebp
    Moderator

    @shanebp

    Have you tried using bp_loggedin_user_domain()?
    It returns the full url.


    maxlinux2000
    Participant

    @maxlinux2000

    YESS!! Now it’s working!

    😀

    tnx for the tips!

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