Hi there!
I was trying out the code on this Buddydev blog with regards to adding a send private button on the member’s directory.
https://buddydev.com/add-send-private-message-button-in-members-directory-on-a-buddypress-network/
But since I am integrating BP Messages plugin on my buddypress site, it doesn’t get the required link to specific user’s BP messages.
Whenever I click the send private message on the member’s directory, it only directs me to my generic messages page (https://prnt.sc/sxmrsc) and NOT the specific user’s direct message page(https://prnt.sc/sxmraq).
In this case, what is the modification needed to the code?
Regards,
DanielHi Daniel,
Thank you for using the code..
I do not use the better message plugin, I regret my inability to help with the link. Will suggest asking developers of the better message plugin for correct function to use.Regards
BrajeshHello Daniel,
You could try the following code in your function.php
/** * Get a link to send a BetterMessage PM to the given User. * * @param int $user_id user id. * * @return string */ function bm_get_send_private_message_to_user_url( $user_id ) { return bp_loggedin_user_domain() . 'bp-messages/?new-message&fast=1&to=' . bp_core_get_username( $user_id ); }
- This reply was modified 4 years, 5 months ago by Sotiris.
You must be logged in to reply to this topic.