Site logo

Archived topic

No options for BP conten in the display location rules.

10 replies · Started by Carsten on March 23, 2020

Viewing posts 1–11 of 11

Hi there, I'm testing the use of a hook to replace my BuddyPress private message button, but the problem with this solution is, that the BP content is not an option in the display location rules.

Members page where the button should be displayed is https://domain/members/username/, where the username of course is dynamic.

Any solution to this problem?, would it be possible to include BP pages?

Hi there,

does Member not show up in the list of Display Rule locations ?

No, no Member in the list

I recall from your other topics that you removed the button from the bp_member_header_actions hook.

So in the Hook Element, you can select Custom Hook from the Hooks list and add bp_member_header_actions to the field provided.

Then you can use the Entire Site Display Rules.

The button has not been removed yet


			// Messages button.
			if ( bp_is_active( 'messages' ) )
				add_action( 'bp_member_header_actions',    'bp_send_private_message_button', 20 );

I added the custom hook, but I can't see any new display rule for member?

What i am suggesting is that:

1. Use choose a custom Hook that exists ONLY where you need that element to be displayed.
2. Use the Display Rules: Entire Site - the element will now be displayed only when the Hook is present.

I am not a BuddyPress user but I assume that the bp_member_header_actions will only exist on templates that are visible to memebers.

Not sure if i am missing something Couple of choices.

1. Use a BuddyPress template tag to set the condtion - as you already have the condition you could use that with the Hook:

<?php
if ( bp_is_active( 'messages' ) ) {
?>// Your code here <?php
}
?>

OR

2. Find a BuddyPress hook that is more relevant to your positional needs.
Couldn't find a visual guide - so use the Simply Show Hooks plugin to display hooks on the front end.

Hi again, found the right hook to use, bp_after_member_body. Apparently this is not creating any errors either, so I guess the problem is solved ;-)

Instead of adding a remove_action, my plan is to hide the buttons in the header with CSS.

Thanks

Hi David, my message just crossed your answer, which is in line with my solution. The list of BP actions can be found at buddypress.org.

Thanks again

Awesome - glad to hear that :)

This archived topic is closed to new replies.