BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Cancel Friendship in PHP files
- This topic has 11 replies, 2 contibutors, and was last updated 9 years, 8 months ago by Alyssa.
Question
March 6, 2015 at 11:08 am #36891@msutyler2Where can i find the cancel friendship code. I can’t find it for the life of my. I would like to remove it from the header.
Is there a way to use Firebug to identify what php files is being used?
Answers
March 6, 2015 at 11:57 am #36892@msutyler2@style960 – Hey Paul, you seem to be a bit more active here. Do you have any insight on this?
Thanks as always.
March 6, 2015 at 5:36 pm #36913@alyssa-buddyboss
AlyssaParticipant@msutyler2 here is the file: members/single/members-header.php about line 121, specifically it is part of a BuddyPress action:
do_action( 'bp_member_header_actions' );
This code is within the above action:
add_action( 'bp_member_header_actions', 'bp_add_friend_button' );
You would need to add this under the php section just before/after that line:
remove_action( 'bp_member_header_actions', 'bp_add_friend_button' );
March 6, 2015 at 6:06 pm #36919@msutyler2I actually solved this using CSS. I used display: none to remove from the header and then made the cancel friendship button way less noticeable in the member directory
March 7, 2015 at 1:04 pm #36954@alyssa-buddyboss
AlyssaParticipantOK, I’ll leave this open just in case you have additional issue.
March 8, 2015 at 7:40 am #36986@msutyler2Actually @tjchester, one of my users mentioned it was hard to find where to add friends on my site.
Is there a way to run an if statement in CSS that says, if button reads “Add Friend” then display this CSS and if button reads “Cancel Friendship” then display this CSS?
March 8, 2015 at 7:16 pm #37009@alyssa-buddyboss
AlyssaParticipant@msutyler2 You can try this, but this should probably be done via PHP but that would need to be a BuddyPress support question.
.friendship-button.not_friends{} .friendship-button.is_friend{}
March 8, 2015 at 7:27 pm #37012@msutyler2Like the support here in the forums? Or a customization request?
March 9, 2015 at 11:29 am #37061@alyssa-buddyboss
AlyssaParticipant@msutyler2 I mean here: https://buddypress.org/support/
March 10, 2015 at 8:32 am #37102@msutyler2@tjchester – would something like this hide the massive “Cancel Friendship” button?
.friendship-button.is_friend{
display: none;
}March 10, 2015 at 8:55 am #37109@msutyler2got it. worked. thanks
March 12, 2015 at 7:20 pm #37210@alyssa-buddyboss
AlyssaParticipantGreat, I’ll close this out.
- The question ‘Cancel Friendship in PHP files’ is closed to new replies.