messages_message_get_recipient_ids

Filters the array of recipients IDs.

Description

apply_filters( 'messages_message_get_recipient_ids', (array) $recipient_ids, (string) $recipient_usernames ); 

Parameters (2)

0. $recipient_ids (array)
Array of recipients IDs that were retrieved based on submitted usernames.
1. $recipient_usernames (string)
Array of recipients usernames that were submitted by a user.

Usage

To run the hook, copy the example below.
  1. $recipient_ids = apply_filters( 'messages_message_get_recipient_ids', $recipient_ids, $recipient_usernames ); 
  2.  
  3. if ( !empty( $recipient_ids ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the messages_message_get_recipient_ids callback 
  2. function filter_messages_message_get_recipient_ids( $recipient_ids, $recipient_usernames ) { 
  3. // make filter magic happen here... 
  4. return $recipient_ids
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'messages_message_get_recipient_ids', 'filter_messages_message_get_recipient_ids', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'messages_message_get_recipient_ids', 'filter_messages_message_get_recipient_ids', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-messages/classes/class-bp-messages-message.php  
  1. return apply_filters( 'messages_message_get_recipient_ids', $recipient_ids, $recipient_usernames );