Skip to:
Content
Pages
Categories
Search
Top
Bottom

Quick Question – Username variable?


  • 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)

  • 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)


    Decisionc
    Participant

    @decisionc

    Thanks Burt!

    That solves my problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Quick Question – Username variable?’ is closed to new replies.
Skip to toolbar