Change "private message link"
-
Hi
I want to create a #link in the “private message” button/link that is on the profile page. So when people click on the “private message” button they are taking down to the compose form. This is a nice thing for user on iPhone. It is a little weird to click “private message” and then all mobile users are seeing is their avatar. So I wanted to create a #link.
My problem is that BuddyPress does not pick my custom bp-messages-template.php in my childtheme/buddypress/bp-messages/bp-messages-template.php. Cannot I not move this file over or is it only legacy folder I can move to my child theme?
If I can’t is there anyway to change the below filter for the message link and paste that into my function.php?
function bp_send_private_message_link() {
echo bp_get_send_private_message_link();
}
function bp_get_send_private_message_link() {if ( bp_is_my_profile() || !is_user_logged_in() )
return false;return apply_filters( ‘bp_get_send_private_message_link’, wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/compose/?r=’ . bp_core_get_username( bp_displayed_user_id() ) ) );
}I want to add #messageform to the end of the link.
I am not super skilled at using filters.
Thanks
Philip
-
There is a plugin available which does something similar. Check out BuddyMessageUX by Philopress. It allows you to stay on a profile page and send messages.
Thanks Henry. Will download the plugin and see if it works with some other customisations I got. It might not so that is why I am looking at doing this filter thing similar to this code I am trying to get to work.
function override_button() {
return apply_filters( ‘bp_get_send_private_message_link’, wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/compose/test/?r=’ . bp_core_get_username( bp_displayed_user_id() ) ) );}
add_filter(‘bp_get_send_private_message_link’,’override_button’);
- The topic ‘Change "private message link"’ is closed to new replies.