Filtering bp_get_send_message_button()?
-
It looks like bp_get_send_message_button is reserved for private messages only, and returns a filtered result of bp_get_button according to some private-message-specific parameters.
I’d like to remove the term “Private” from the language, since it is the only kind of messaging I’m going to use, but with two additional requirements:
1) I don’t want to deal with language files
2) I want to keep the customization on this element of BP with the other customizations — i.e. in my functions.phpIt seems I cannot redefine bp_get_send_message_button in my functions.php. When I use an if (!function_exists.. my changes are ignored. When I remove the check, the conflict between the functions is fatal.
How can I override the link_title and link_text without modifying BP core or using language files?
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', ) ) ) ); }
- The topic ‘Filtering bp_get_send_message_button()?’ is closed to new replies.