Skip to:
Content
Pages
Categories
Search
Top
Bottom

Quick Question – Username variable?

  • Avatar of Decisionc
    Decisionc
    Participant

    @decisionc

    Hi,

    I am creating my first plugin for buddypress.

    Is there a variable which is assigned the username of the person logged in.

    Something like $bp_current_user or something?

    I need to create a link to their profile page, so the link would be something like:

    <?php echo “www.example.com/members/”.$bp_current_user.”/profiles”; ?>

    Thanks so much for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Howdy.

    $bp['loggedin_userid']

    Or something else from here : /mu-plugins/bp-core.php

    Never leave home without your globals. Don’t forget to declare your intentions inside of a function:

    function myhandydandyfunction () {
    global $bp; (Andy reminded us of that recently)

    Avatar of Decisionc
    Decisionc
    Participant

    @decisionc

    Thanks Burt!

    That solves my problem.

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

You must be logged in to reply to this topic.