Skip to:
Content
Pages
Categories
Search
Top
Bottom

Modifying members_header_actions


  • noobiestrikesagain
    Participant

    @noobiestrikesagain

    Hey,

    I’m trying to remove bp_add_friend_button from bp_member_header_actions by using

    remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );

    It is not working.
    While I was able to remove follow button (Buddypress Follow plugin) with the following code:
    remove_action( 'bp_member_header_actions', 'bp_follow_add_profile_follow_button' );

    The same code for friendship button is not working.

    I have also tried the following code:

    function remove_add_friend() {
    	 remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
    }
    add_action( 'after_setup_theme', 'remove_add_friend', 11 );

    Any solution to the problem?

    Thanks!

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

  • Henry Wright
    Moderator

    @henrywright

    remove_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); should work.

    Try looking inside your templates to see if the bp_add_friend_button() function is used to output the button directly.


    noobiestrikesagain
    Participant

    @noobiestrikesagain

    Hey,

    Where are templates located? Can you tell me the file name I should be looking for?

    Thanks


    Henry Wright
    Moderator

    @henrywright

    Run a search in your code base for bp_add_friend_button(). Depending on your theme it could be in quite a few files.


    noobiestrikesagain
    Participant

    @noobiestrikesagain

    Hey,


    @henrywright
    I’m sorry I’m new to this and I don’t know how to “search in code base”.


    Henry Wright
    Moderator

    @henrywright

    Do you have files locally on your own computer or are they on a server elsewhere?


    noobiestrikesagain
    Participant

    @noobiestrikesagain

    It’s on the computer locally.


    Henry Wright
    Moderator

    @henrywright

    OK. So if you open the project in a text editor such as Light Table or Brackets, then hit Ctrl + F, you should see a search box appear which will let you find what you need to.


    noobiestrikesagain
    Participant

    @noobiestrikesagain

    Okay. So I was able to open the folder. But I’m not able to run search in this whole folder.
    Here’s my window:


    noobiestrikesagain
    Participant

    @noobiestrikesagain

    UPDATE: I found the template in member-header.php

    It’s <?php do_action( 'bp_member_header_actions' );?> and I can confirm it.

    I tried removing the code from the file, It remove all the buttons including `bp_add_friend_button’.

    Is there any way to remove only `bp_add_friend_button’?

    Thanks

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