Skip to:
Content
Pages
Categories
Search
Top
Bottom

button only on member ‘s profile


  • luisa227
    Participant

    @luisa227

    do you remember that in the user profile appear as buttons to write private or public messages?
    I would like to add more buttons (and I did it – I do not remember which files have changed…) but I wish these buttons are only visible in your profile and not at all (thus the reverse of what happens to the buttons of the listed messages above). How can I do? thank you

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

  • luisa227
    Participant

    @luisa227

    Update: i remember … I modified the file cover-image-header.php adding a sinple code with link

    <div class="generic-button" id="generic-buttonid"><a href="http://mysite?page=swap" class="" id="button-1" rel="">Gestisci Swap</a></div>
    	<div class="generic-button" id="generic-buttonid"><a href="http://mysite?page=newswap" class="" id="button-1" rel="">Aggiungi Swap</a></div>

    I need to put it into a IF statement that says “if my profile is then display them”… there is a variable to see if the profile is mine or that of others? thanks


    luisa227
    Participant

    @luisa227

    Solved !! 🙂
    Maybe there was a faster, simpler code, but I have done so (if anything serves to someone):

    $current_user = wp_get_current_user();
    
    $userID = bp_displayed_user_id();
    $userURL = bp_core_get_username($userID);
    
    $current_user= $current_user->user_login;
     
    if ($current_user == $userURL) {...}

    😉


    shanebp
    Moderator

    @shanebp

    if( get_current_user_id() == bp_displayed_user_id() ) { etc.

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