This will help you. It shows you how to change most of the text labels and messages outputted by BuddyPress:
https://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/
That process seems beyond me and very long (and I cannot find the /plugins/buddypress/bp-languages folder) I just want to change the “Private Message” button label. Can I access/change it quickly like this:
1. access buddypress/bp-messages/bp-messages-template.php
2. change the ‘link text’ to the new label name in this block of code?
function bp_get_send_message_button() {
// Note: ‘bp_get_send_message_button’ is a legacy filter. Use
// ‘bp_get_send_message_button_args’ instead. See #4536
return apply_filters( ‘bp_get_send_message_button’,
bp_get_button( apply_filters( ‘bp_get_send_message_button_args’, array(
‘id’ => ‘private_message’,
‘component’ => ‘messages’,
‘must_be_logged_in’ => true,
‘block_self’ => true,
‘wrapper_id’ => ‘send-private-message’,
‘link_href’ => bp_get_send_private_message_link(),
‘link_title’ => __( ‘Send a private message to this user.’, ‘buddypress’ ),
‘link_text’ => __( ‘Private Message’, ‘buddypress’ ),
‘link_class’ => ‘send-message’,
) ) )
You could do it like that but each time you update BuddyPress you’ll lose the changes you’ve made to bp-messages-template.php. I’d try to avoid making changes to the plugin core.
actually you could make use of the bp_send_private_message_link
function and do it like this:
<a href="<?php bp_send_private_message_link() ?>" title="Private Message">Private Message</a>
You can change the “Private Message” text to whatever you like. You’d just paste the code into your theme where ever you’d like the button to appear
@henrywright-1
And how would you avoid double buttons due to this call in member-header.php?
do_action( ‘bp_member_header_actions’ );
@tayenewm
Use the provided apply_filters:
function tweak_button_label ( $args ) {
$args[link_text] = 'Something';
return $args;
}
add_filter( 'bp_get_send_message_button_args', 'tweak_button_label', 1, 1 );
@shanebp good point about using the bp_send_private_message_link approach. Although you would avoid double buttons by using a translation file.
@shanebp,
Thanks for your snippet which works great with standard buddypress message system but did not work if using BP Profile Message UX plugin, is there anyway to make it work please
https://wordpress.org/plugins/bp-profile-message-ux/
tahnks
@funmi-omoba
Open the plugin file, find the text, replace the text
@shanebp,
thanks for your reply I thought as much but I think it get wiped during the plugin update.
Thanks for your input anyways.
Best Regards