Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Location of bp_member_header_actions ?

@hastig

Participant

Thanks very much guys!

Is it just my blind eyes or is hookr.io impossible to read? Font size is tiny, color is invisible. A fantastic resource though, bookmarked it, thanks again!

For anybody interested, I just wanted a ‘send private message’ button that I could place anywhere on the page.

The simple way seems to be to use this..

<?php bp_send_private_message_button(); ?>

On click it will open the send message page with the person you want to message already set.

bp_send_private_message_button is a function that echos bp_get_send_message_button
bp_send_private_message_button is located in /bp-messages/bp-messages-template.php

source http://hookr.io/plugins/buddypress/2.4.3/functions/bp_send_private_message_button/

if you’re wanting to change the text of the link you can add this to functions.php or bp-custom.php

function custom_change_send_private_message_text($args) { 
	$args[link_text] = 'send message'; 
	return $args;
}
add_filter( 'bp_get_send_message_button_args', 'custom_change_send_private_message_text', 1, 1 );

..thats courtesy of shanebp..
https://buddypress.org/support/topic/private-message-button-label-change/

another version i was playing with if its of use to anyone..

function custom_change_send_private_message_text($args) { 
	$userName = bp_get_displayed_user_username();
	$args[link_text] = 'send ' . $userName . ' a private message'; 
	return $args;
}
add_filter( 'bp_get_send_message_button_args', 'custom_change_send_private_message_text', 1, 1 );

..you would have to figure out how to remove the hyphen from the username.

Skip to toolbar