How to link the participants name to their profile?


Home Forums Front End PM PRO How to link the participants name to their profile?

This topic is: Resolved
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #14629
    Utsav Sarkar
    Participant

    When 2 participants are messaging one another, I want their usernames to link to their profile. Currently, if I click on the username, it toggles the messages on and off. I dont want the toggle feature at all.

    #14643
    Shamim Hasan
    Keymaster

    By default wordpress doesn’t have a user profile page. Which page you want to link? author posts page?

    #14658
    Utsav Sarkar
    Participant

    I am using Ultimate Member so the user profile link is /user/username/

    For example: /user/eddie-ortisi/

    #14663
    Shamim Hasan
    Keymaster

    add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_filter_user_name', function( $name, $id ){
    	if( isset( $_GET['fepaction'] ) && 'viewmessage' == $_GET['fepaction'] && function_exists( 'um_fetch_user' ) ){
    		um_fetch_user( $id );
    		$name = '<a href="' . um_user_profile_url() . '">' . $name . '</a>';
    	}
    	return $name;
    }, 10, 2);
    
    #14684
    Utsav Sarkar
    Participant

    Thanks this works. However, is there a way to remove the toggle function completely? Currently, when you click on the participant’s name, it hides the message first and then takes you to the user’s profile.

    #14713
    Shamim Hasan
    Keymaster

    add following code in your theme’s (child theme’s if any) functions.php

    add_action( 'wp_enqueue_scripts', function(){
    	wp_deregister_script( 'fep-replies-show-hide' );
    });
    

    Update:
    add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_filter_hide_message_initially_if_read', '__return_false' );
    
    #14759
    Utsav Sarkar
    Participant

    awesome bro this worked. thank you!

    #14945
    Utsav Sarkar
    Participant

    Hey I just checked some email logs on my website realized that {{sender}} and {{receiver}} usernames inside the email notifications are being linked to their user profiles as well. This is good. However, the link appears in the subject as well. Please see screenshot.

    How can I remove the link from the subject but still keep the links inside the email?

    Attachments:
    You must be logged in to view attached files.
    #14951
    Shamim Hasan
    Keymaster

    add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_filter_before_email_send', function( $content ){
    	$content['subject'] = strip_tags( $content['subject'] );
    	return $content;
    }, 99);
    
    #14968
    Utsav Sarkar
    Participant

    for some reason, the links don’t work in the “New Message” template. But they work in the “Reply Message” template. Is there a way to make them work on the “New Message” template as well?

    #14977
    Shamim Hasan
    Keymaster

    remove previous code and add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_filter_user_name', function( $name, $id ){
    	if( function_exists( 'um_fetch_user' ) ){
    		um_fetch_user( $id );
    		$name = '<a href="' . um_user_profile_url() . '">' . $name . '</a>';
    	}
    	return $name;
    }, 10, 2);
    
    #14988
    Utsav Sarkar
    Participant

    i removed the previous code and added the new one. however, the link appears in the subject again. so put both codes and its working as expected. thank you

    #15027
    Shamim Hasan
    Keymaster
    #16907
    Utsav Sarkar
    Participant

    Hey this thing is not working after the version 10 update.

    1) link the participants name to their ultiamate member profile
    2) remove the toggle function completely

    #16913
    Shamim Hasan
    Keymaster

    These are working, I have tested it now in my test website and it is working. Also nothing is changed in these hooks.

    Please make sure your code is in right place ( in your theme’s (child theme’s if any and active) functions.php )

    Let me know.

Viewing 15 posts - 1 through 15 (of 22 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.