Skip to:
Content
Pages
Categories
Search
Top
Bottom

Quick Question – Username variable?

  • @decisionc

    Participant

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

    Participant

    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

    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