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 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #18455
    Utsav Sarkar
    Participant

    Hi Shamim,

    I wanted the toggle feature to be disabled by default so that users can see the messages at all times. Hence, I have the following code in my functions.php

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

    However, after the Version 10.1.4 upgrade, the messages are toggled off by default. how can I remove the toggle feature again so that users can see the messages

    #18458
    Shamim Hasan
    Keymaster
    #26392
    c-alle
    Participant

    I tried to insert this code:

    add_filter( 'fep_filter_before_email_send', function( $content ){
    	$content['subject'] = strip_tags( $content['subject'] );
    	return $content;
    }, 99);
    
    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);
    

    [MODERATOR]- please put code between backticks

    and it works, but there is a problem, when I click on new message and choose the recipient name, before the name I get <a href = “etc … with the address of the recipient profile.

    #26417
    Shamim Hasan
    Keymaster

    You can check if it is view message page first.
    So your code line if( function_exists( 'um_fetch_user' ) ){ will be if( function_exists( 'um_fetch_user' ) && isset( $_GET['fepaction'] ) && 'viewmessage' === $_GET['fepaction'] ){

    Let me know.

    #26435
    c-alle
    Participant

    Thanks, so it doesn’t work in the messagebox, while in viewmessage it works, but if I switch from one message to another it loses the <ahfer of the participants and only gives me the name back.

    #26441
    Shamim Hasan
    Keymaster

    Please use this code

    add_filter( 'fep_filter_user_name', function( $name, $id ){
    	if ( $name && function_exists( 'um_fetch_user' ) && fep_get_the_id() ) {
    		um_fetch_user( $id );
    		$name = '<a href="' . um_user_profile_url() . '">' . $name . '</a>';
    	}
    	return $name;
    }, 10, 2);
    
    #26443
    c-alle
    Participant

    With this code it works perfectly. Thank you. 🙂

Viewing 7 posts - 16 through 22 (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.