Skip to:

Opened 7 months ago

Last modified 7 months ago

#8293 new enhancement

Add filter to allow manipulation of recipients in message thread

Reported by: mangopeargroup Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 5.2.0
Component: Messages Keywords:


It would be quite useful to be able to manipulate the list of receipients shown on a message thread (i.e. adding additional data to array or amending the order of the list that's shown).

By adding a filter, we can manipulate the array of recipients before they're AJAX-ed to the template.

Line 460

return apply_filters( 'bp_get_user_message_threads_recipients', $thread->thread['recipients'] );

My use case is that I want to custom sort the list by user meta and I think this is the easiest, and best, way of doing so.

Change History (1)

#1 @mangopeargroup
7 months ago

Whoops! Wrong filter format. Below is the correct format (I've tested it and it works).

Line 460

$thread->thread['recipients'] = apply_filters( 'bp_get_user_message_thread_recipients', $thread->thread['recipients'] );
Note: See TracTickets for help on using tickets.