Home › Forums › Front End PM PRO › fep_filter_read_receipt example and message recipient › Reply To: fep_filter_read_receipt example and message recipient
		July 22, 2020 at 4:14 pm
		
		#39528
		
		
		
	
		
		little.chimp
	Participant
		
		
	So this will filter the name and date, time.
add_filter( 'fep_filter_read_receipt_individual', function( $receipt, $time, $participant ){
    if ($time > strtotime('-1 day')) {
		$time = sprintf( __( '%s', 'front-end-pm' ), date("G:i", $time) );
		// $time = sprintf( __( '%s ago', 'front-end-pm' ), human_time_diff($time) );
	} elseif ($time > strtotime('-6 day')) {
		$time = sprintf( __( '%s', 'front-end-pm' ), date("D G:i", $time) );
	} else { 
		$time = sprintf( __( '%s', 'front-end-pm' ), date("j M Y, G:i", $time) );
	}
	return '<b>Read</b> ' . $time;
}, 10, 3);
// Read 21:18
How do I filter out the <hr /><div class=”fep-read-receipt”>…</div>?
This was what I came up with before you pointed me towards the _individual filter…
add_filter( 'fep_filter_read_receipt', function(){	
	$participants = FEP_Participants::init()->get( fep_get_the_id(), false, true );
	$time = array();
	foreach ( $participants as $participant ) {
		if ( ! $participant->mgs_read ) {
			continue;
		}
		if ( fep_get_message_field( 'mgs_author' ) == $participant->mgs_participant ) {
			continue;
		}
		$time = $participant->mgs_read;
	}
	return 'Read ' . date('G:i', $time);
}, 10, 2);
But I know that’s not the right way to do it. I’m still trying to feel my way through the plugin, but getting there.