Add toolbar tip to Send Private Message icon on Profile pages

Home Forums Gwangi – Dating & Matchmaking Community Theme Popular Features Member Profile Add toolbar tip to Send Private Message icon on Profile pages

This topic contains 8 replies, has 2 voices, and was last updated by  Des Somebody 3 weeks, 1 day ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5548

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    The Members’ page has a toolbar tip (“Send a private message to this user.”) at the “Send Private Message” icon at the bottom of each profile photo. For consistency, the same toolbar tip should be shown at the “Send Private Message” icon at the bottom of the photo on the Profile page. Is there a simple way to achieve this?

    Cheers.

    #5549

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    PS I should have said “tooltip” instead of “toolbar tip”.

    #5562

    Themosaurus
    Keymaster
    • 1665 Posts
    @themosaurus

    Hi @elsades,

    To change this, simply add the following code snippet to your website:

    if ( ! function_exists( 'gwangi_buddypress_member_send_private_message_button' ) ) :
    	/**
    	 * Print the HTML for the BP button for the private messaging form.
    	 *
    	 * @since 1.0.0
    	 */
    	function gwangi_buddypress_member_send_private_message_button() {
    		if ( is_user_logged_in() ) :
    			$user_id = bp_get_member_user_id();
    
    			if ( false !== $user_id && bp_loggedin_user_id() !== $user_id ) :
    
    				$link_href = apply_filters( 'gwangi_buddypress_member_send_private_message_button_url', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $user_id ) ), $user_id );
    
    				bp_button( array(
    					'id'                => "private_message-{$user_id}",
    					'component'         => 'messages',
    					'must_be_logged_in' => true,
    					'block_self'        => true,
    					'wrapper_id'        => "send-private-message-{$user_id}",
    					'wrapper_class'     => 'send-private-message',
    					'link_href'         => $link_href,
    					'link_title'        => esc_html__( 'Send Private Message', 'gwangi' ),
    					'link_text'         => esc_html__( 'Private Message', 'gwangi' ),
    					'link_class'        => 'send-message',
    				) );
    
    			endif;
    		endif;
    	}
    endif;

    To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:

    Adding Custom PHP Without Changing Your Child Theme

    We hope this will solve your issue. 🙂

    Best,

    #5571

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    I tried your suggestion but still no tool tip is appearing when hovering over the “Send Private Message” icon on the Profile page.

    Cheers

    #5578

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    But the tooltip text on the Members page now reads “Send Private Message” instead of “Send a private message to this user.”.

    #5598

    Themosaurus
    Keymaster
    • 1665 Posts
    @themosaurus

    Hi @elsades,

    Could you be more specific please? It the tooltip text is now correct, this issue should be solve… Or maybe you’re trying to achieve another thing that we might have missed.

    Thank you for clarifying.

    Cheers,

    #5604

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    Apparently I wasn’t clear in my original query. I will try to clarify what I am wanting to achieve.

    I am referring to two different pages – “Members’ Directory” (MD) page and “Member’s Profile” (MP) page.
    The tooltip appears on the MD page but not on the MP page. I would like it to appear on both pages.

    Thanks.

    #5612

    Themosaurus
    Keymaster
    • 1665 Posts
    @themosaurus

    Hi @elsades,

    Thank you for your clarification.
    This issue will be fixed in our theme with the next update.

    Best,

    #5614

    Des Somebody
    Participant
    • 29 Posts
    @elsades

    Thank you.

    Cheers

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.