#3749 closed enhancement (fixed)
Default "bp_member_header_actions" buttons should be hooked at different priorities
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | trivial | Version: | 1.2.6 |
Component: | Templates | Keywords: | has-patch |
Cc: |
Description
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.
eg.
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)
Note: See
TracTickets for help on using
tickets.
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.