Skip to:
Content
Pages
Categories
Search
Top
Bottom

hide the button “add friend” in the list of members


  • HDcms
    Participant

    @hdcms

    Hello,
    How to hide the button “add friend” in the list of members?
    https://screenshots.firefox.com/RkzmrYSm2wxls4a3/null

    The following code does not work on this page while running on a profile

    add_action(‘bp_init’,’bp_custom_remove_friendship_btn_on_profile’);
    function bp_custom_remove_friendship_btn_on_profile(){…
    if (has_action(‘bp_member_header_actions’, ‘bp_add_friend_button’) ) {
    remove_action( ‘bp_member_header_actions’, ‘bp_add_friend_button’, 5 );
    }
    }

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • wow, with that code I would say you are taking things too far. Just use page inspector tool to trace the CSS and remove it.

    Right-click on the add-friend button and select ‘inspect element’. Then go to the CSS, on the right tab of the inspection tool. I would suggest you make the edit in a child theme so that it won’t go out on an update.

    did u understand?


    HDcms
    Participant

    @hdcms

    HI,
    Yes I understood. I will do it with the css if I can not do it otherwise (but not too familiar with someone who has a code to share)
    In addition I do not understand why it works in one case and not in the other??
    Regards

    “In addition I do not understand why it works in one case and not in the other??
    Regards”
    it sounded like you got the code from someone it worked for, maybe there has been an update in BP Core and it might not work.

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