Skip to:
Content
Pages
Categories
Search
Top
Bottom

Automatically Displaying User’s Email Address on their Profile Page

  • Avatar of lwaltzer
    lwaltzer
    Participant

    @lwaltzer

    Using the following function, I’m able to hook a display of a user’s email address into their profile page:

    `
    function DisplayedUserEmail() {
    global $bp;
    echo ‘ ‘ . ‘Email Address: ‘ . ‘

    ‘ . ‘ ‘ . $bp->displayed_user->userdata->user_email . ‘

    ‘;
    }

    add_action( ‘bp_profile_field_item’, ‘DisplayedUserEmail’ );
    `

    … the problem is, the function appears after every other profile field that has data, repeating the listing a bunch of times… Is it possible to limit this to display only once while still hooking into that action?

Viewing 1 replies (of 1 total)
  • Avatar of lwaltzer
    lwaltzer
    Participant

    @lwaltzer

    Fixed:

    `
    function DisplayedUserEmail() {
    global $bp;
    echo ‘

    ‘ . ‘
    ‘ . ‘

    ‘ . ‘

    ‘ . ‘

    ‘ . ‘Email Address: ‘ . ‘ ‘ . $bp->displayed_user->userdata->user_email . ‘

    ‘ . ‘

    ‘;
    }

    add_action( ‘bp_after_profile_field_content’, ‘DisplayedUserEmail’ );
    `

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.