Skip to:

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#3749 closed enhancement (fixed)

Default "bp_member_header_actions" buttons should be hooked at different priorities

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.6 Priority: normal
Severity: trivial Version: 1.2.6
Component: Templates Keywords: has-patch


Let's say I want to place a button in between the "Add Friend" button and the "Public Message" button on a member page.

Right now, I can't do this without unhooking the default buttons and placing them at a lower priority.

A way to remedy this is to set priorities for the public and private message buttons in functions.php.


		if ( bp_is_active( 'friends' ) )
			add_action( 'bp_member_header_actions',    'bp_add_friend_button' );

		// Activity button
		if ( bp_is_active( 'activity' ) )
			add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );

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

should be:

		if ( bp_is_active( 'friends' ) )
			add_action( 'bp_member_header_actions',    'bp_add_friend_button' );

		// Activity button
		if ( bp_is_active( 'activity' ) )
			add_action( 'bp_member_header_actions',    'bp_send_public_message_button', 20 );

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

The same should be done for buttons hooked to "bp_group_header_actions" as well.

Attachments (1)

3749.01.patch (1.3 KB) - added by r-a-y 13 years ago.

Download all attachments as: .zip

Change History (5)

13 years ago

#1 @r-a-y
13 years ago

  • Keywords has-patch added

In the patch, I've hooked the "Add Friend" button and "Join Group" button to priority 9 as those should be the first buttons shown on a member and group page respectively.

Feel free to change the priorities though.

#2 @boonebgorges
13 years ago

  • Milestone changed from Awaiting Review to 1.6

Nice idea.

#3 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5461]) Don't use default priorities when attaching _header_action buttons, so that plugins and themes can more easily place custom navigation and action items. Fixes #3749. Props r-a-y

#4 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.