Support » Plugin: Front End PM » fep_filter_user_name – don’t show in blocking alerts

  • Resolved Sean Turtle

    (@turts)


    Hi. I’ve used this filter (thanks!) to amend the display name of a user (in the user name column), but it’s also showing the amended string when someone blocks a user. I’d like it to just show their name there.

    Is this possible?

    Thanks
    Sean

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Shamim Hasan

    (@shamim51)

    Can you please give me a screenshot where you do not want to append? Which name you want to show there?

    Thread Starter Sean Turtle

    (@turts)

    So, in the alert box when you click to block someone, I don’t want the new string I’ve applied using that filter to be shown.

    For the alert box, I just want it to remain as you’ve coded it.

    Does that make sense?

    Plugin Author Shamim Hasan

    (@shamim51)

    May you please let me know what code you use to amend user name?

    Thread Starter Sean Turtle

    (@turts)

    add_filter( 'fep_filter_user_name', function( $name, $id ){
    	if ( $name && fep_get_the_id() ) {
        $name = '<a href="/member/' . $id .'">' . $name . '</a>';
    	}
    	return $name;
    }, 10, 2);
    Plugin Author Shamim Hasan

    (@shamim51)

    try following code

    add_filter( 'fep_filter_display_participants', function( $par_string, $par ){
    	foreach( $par as &$string ){
    		$string = preg_replace( esc_attr( "/<a\s(.+?)>(.+?)<\/a>/is" ), "$2", $string);
    	}
    	return implode( ', ', $par );
    }, 10, 2);
    
    • This reply was modified 1 year ago by Shamim Hasan. Reason: forum decoded < and >
    Thread Starter Sean Turtle

    (@turts)

    Thank you so much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘fep_filter_user_name – don’t show in blocking alerts’ is closed to new replies.