Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*$user_id= User whose blog this is*/
- ?>
- <div id="item-buttons">
- <?php if ( function_exists( 'bp_add_friend_button' ) ) : ?>
- <?php bp_add_friend_button($user_id) ?>
- <?php endif; ?>
- <?php if ( is_user_logged_in() && function_exists( 'bp_get_send_private_message_link_on_blog' ) ) : ?>
- <div class="generic-button" id="post-mention">
- <a href="<?php echo bp_get_send_public_message_link_on_blog($user_id); ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
- </div>
- <?php endif; ?>
- <?php if ( is_user_logged_in() && function_exists( 'bp_get_send_public_message_link_on_blog' ) ) : ?>
- <div class="generic-button" id="send-private-message">
- <a href="<?php echo bp_get_send_private_message_link_on_blog($user_id); ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
- </div>
- <?php endif; ?>
- </div><!-- #item-buttons -->
- <?php
- //custom function for public message link, please put the below code in your functions.php
- function bp_get_send_public_message_link_on_blog($user_id) {
- global $bp;
- return apply_filters( 'bp_get_send_public_message_link_on_blog', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $user_id) );
- }
- //custom function for private message link
- function bp_get_send_private_message_link_on_blog($user_id) {
- global $bp;
- return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $user_id ) );
- }
- ?>
Add Comment
Please, Sign In to add comment