Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to replace a core function

@manu-pb

Participant

@shanebp
Many thanks, I was able to remove the sender from the list of recipients with this custom function :

function manu_bp_message_thread_to( $recipients ) {
	global $messages_template;
	foreach( (array) $messages_template->thread->recipients as $object ) {
		if ( (int) $object->user_id !== bp_loggedin_user_id() ) {
			$sender_links[] = bp_core_get_userlink( $object->user_id );
		}
	}
	$recipients = implode( ', ', (array)$sender_links );
	return $recipients;
}
add_filter('bp_message_thread_to', 'manu_bp_message_thread_to', 20, 1);
Skip to toolbar