bp_get_send_private_message_link()
Generate the URL for the Private Message link in member profile headers.
Description
Return
(bool|string) False on failure, otherwise the URL.
Source
File: bp-messages/bp-messages-template.php
function bp_get_send_private_message_link() { if ( bp_is_my_profile() || ! is_user_logged_in() ) { return false; } if ( bp_displayed_user_id() > 0 ) { $user_id = bp_displayed_user_id(); } else if ( ! empty( $_GET['user'] ) && is_string( $_GET['user'] ) ){ $user_id = absint( $_GET['user'] ); }else { $user_id = $GLOBALS["members_template"]->member->ID; } /** * Filters the URL for the Private Message link in member profile headers. * * @since BuddyPress 1.2.10 * * @param string $value URL for the Private Message link in member profile headers. */ 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( $user_id ) ) ); }
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.