Skip to:
Content
Pages
Categories
Search
Top
Bottom

Private Message Button Label Change


  • tayenewm
    Participant

    @tayenewm

    Please advise how I can change the text on the “Private Message” button.
    Currently using WP version 3.5.2 BuddyPress version 1.8.1 with the Avada theme by Themeforest.
    Here is a link to the site: http://69.195.124.60/~youngwo8/

    Thanks in advance,
    taye

Viewing 9 replies - 1 through 9 (of 9 total)

  • Henry
    Member

    @henrywright-1

    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/


    tayenewm
    Participant

    @tayenewm

    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’,
    ) ) )


    Henry
    Member

    @henrywright-1

    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.


    Henry
    Member

    @henrywright-1

    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


    shanebp
    Moderator

    @shanebp

    @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 );

    Henry
    Member

    @henrywright-1

    @shanebp good point about using the bp_send_private_message_link approach. Although you would avoid double buttons by using a translation file.


    funmi omoba
    Participant

    @funmi-omoba

    @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


    shanebp
    Moderator

    @shanebp

    @funmi-omoba

    Open the plugin file, find the text, replace the text


    funmi omoba
    Participant

    @funmi-omoba

    @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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Private Message Button Label Change’ is closed to new replies.
Skip to toolbar